Class: Lotus::Commands::New
- Inherits:
-
Object
- Object
- Lotus::Commands::New
- Defined in:
- lib/lotus/commands/new.rb
Overview
Constant Summary collapse
- GENERATORS_NAMESPACE =
"Lotus::Generators::Application::%s".freeze
Instance Attribute Summary collapse
- #app_name ⇒ Object readonly
- #cli ⇒ Object readonly
- #options ⇒ Object readonly
- #source ⇒ Object readonly
- #target ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(app_name_or_path, environment, cli) ⇒ New
constructor
A new instance of New.
- #start ⇒ Object
Constructor Details
#initialize(app_name_or_path, environment, cli) ⇒ New
Returns a new instance of New.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lotus/commands/new.rb', line 14 def initialize(app_name_or_path, environment, cli) @app_name = ApplicationName.new(_get_real_app_name(app_name_or_path)) @options = environment. @arch = @options.fetch(:architecture) @target = Pathname.pwd.join(@options.fetch(:path, app_name_or_path)) @source = Pathname.new(@options.fetch(:source) { ::File.dirname(__FILE__) + '/../generators/application/' }).join(@arch) @cli = cli require "lotus/generators/application/#{ @arch }" command = Utils::String.new(@arch).classify @command = Utils::Class.load!(GENERATORS_NAMESPACE % command).new(self) end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
12 13 14 |
# File 'lib/lotus/commands/new.rb', line 12 def app_name @app_name end |
#cli ⇒ Object (readonly)
12 13 14 |
# File 'lib/lotus/commands/new.rb', line 12 def cli @cli end |
#options ⇒ Object (readonly)
12 13 14 |
# File 'lib/lotus/commands/new.rb', line 12 def @options end |
#source ⇒ Object (readonly)
12 13 14 |
# File 'lib/lotus/commands/new.rb', line 12 def source @source end |
#target ⇒ Object (readonly)
12 13 14 |
# File 'lib/lotus/commands/new.rb', line 12 def target @target end |
Instance Method Details
#start ⇒ Object
29 30 31 |
# File 'lib/lotus/commands/new.rb', line 29 def start @command.start end |