Class: CreateRubyApp::App
- Inherits:
-
Object
- Object
- CreateRubyApp::App
- Defined in:
- lib/create_ruby_app/app.rb
Constant Summary collapse
- RUBY_VERSION =
"ruby-2.6.2"
Instance Attribute Summary collapse
-
#gems ⇒ Object
readonly
Returns the value of attribute gems.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #classify_name ⇒ Object
-
#initialize(name: "app", gems: [], version: RUBY_VERSION, logger: Logger.new(STDOUT)) ⇒ App
constructor
A new instance of App.
- #run! ⇒ Object
Constructor Details
#initialize(name: "app", gems: [], version: RUBY_VERSION, logger: Logger.new(STDOUT)) ⇒ App
Returns a new instance of App.
7 8 9 10 11 12 13 14 15 16 17 |
# 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 |
Instance Attribute Details
#gems ⇒ Object (readonly)
Returns the value of attribute gems.
31 32 33 |
# File 'lib/create_ruby_app/app.rb', line 31 def gems @gems end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
31 32 33 |
# File 'lib/create_ruby_app/app.rb', line 31 def logger @logger end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/create_ruby_app/app.rb', line 31 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
31 32 33 |
# File 'lib/create_ruby_app/app.rb', line 31 def version @version end |
Instance Method Details
#classify_name ⇒ Object
27 28 29 |
# File 'lib/create_ruby_app/app.rb', line 27 def classify_name name.split("_").collect(&:capitalize).join end |
#run! ⇒ Object
19 20 21 22 23 24 25 |
# 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 |