class CreateRubyApp::App
Constants
- RUBY_VERSION
Attributes
gems[R]
logger[R]
name[R]
version[R]
Public Class Methods
new( name: "app", gems: [], version: RUBY_VERSION, logger: Logger.new(STDOUT) )
click to toggle source
# File lib/create_ruby_app/app.rb, line 7 def initialize( name: "app", gems: [], version: RUBY_VERSION, logger: Logger.new(STDOUT) ) @name = name @gems = gems @version = version @logger = logger end
Public Instance Methods
classify_name()
click to toggle source
# File lib/create_ruby_app/app.rb, line 27 def classify_name name.split("_").collect(&:capitalize).join end
run!()
click to toggle source
# File lib/create_ruby_app/app.rb, line 19 def run! with_logger("Creating directories...", Actions::CreateDirectories) with_logger("Generating files...", Actions::GenerateFiles) with_logger("Making script executable...", Actions::MakeScriptExecutable) with_logger("Installing gems...", Actions::InstallGems) with_logger("Happy hacking!", Actions::NullAction) end
Private Instance Methods
with_logger(text, action)
click to toggle source
# File lib/create_ruby_app/app.rb, line 37 def with_logger(text, action) logger.info(text) action.call(self) end