Class: Rigit::Commands::Build::BuildHandler
- Inherits:
-
Object
- Object
- Rigit::Commands::Build::BuildHandler
- Includes:
- Colsole
- Defined in:
- lib/rigit/commands/build.rb
Overview
Internal class to handle scaffolding for the Rigit::CommandLine class.
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#force ⇒ Object
readonly
Returns the value of attribute force.
-
#overwrite_all ⇒ Object
Returns the value of attribute overwrite_all.
-
#rig_name ⇒ Object
readonly
Returns the value of attribute rig_name.
-
#skip_all ⇒ Object
Returns the value of attribute skip_all.
-
#target_dir ⇒ Object
readonly
Returns the value of attribute target_dir.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args) ⇒ BuildHandler
constructor
A new instance of BuildHandler.
Constructor Details
#initialize(args) ⇒ BuildHandler
Returns a new instance of BuildHandler.
17 18 19 20 21 22 |
# File 'lib/rigit/commands/build.rb', line 17 def initialize(args) @args = args @rig_name = args['RIG'] @force = args['--force'] || (config.has_key?(:force) && config.force) @target_dir = '.' end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
12 13 14 |
# File 'lib/rigit/commands/build.rb', line 12 def args @args end |
#force ⇒ Object (readonly)
Returns the value of attribute force.
12 13 14 |
# File 'lib/rigit/commands/build.rb', line 12 def force @force end |
#overwrite_all ⇒ Object
Returns the value of attribute overwrite_all.
13 14 15 |
# File 'lib/rigit/commands/build.rb', line 13 def overwrite_all @overwrite_all end |
#rig_name ⇒ Object (readonly)
Returns the value of attribute rig_name.
12 13 14 |
# File 'lib/rigit/commands/build.rb', line 12 def rig_name @rig_name end |
#skip_all ⇒ Object
Returns the value of attribute skip_all.
13 14 15 |
# File 'lib/rigit/commands/build.rb', line 13 def skip_all @skip_all end |
#target_dir ⇒ Object (readonly)
Returns the value of attribute target_dir.
12 13 14 |
# File 'lib/rigit/commands/build.rb', line 12 def target_dir @target_dir end |
Instance Method Details
#execute ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rigit/commands/build.rb', line 24 def execute say "Building g`#{rig_name}`" say config.intro if config.has_key? :intro verify_dirs arguments = prompt.get_input params scaffold arguments say config.has_key?(:outro) ? config.outro : 'Done' end |