Class: RubiGen::Base
- Inherits:
-
Object
- Object
- RubiGen::Base
- Defined in:
- lib/sprout/generator/base_mixins.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(runtime_args, runtime_options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ Base
Returns a new instance of Base.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/sprout/generator/base_mixins.rb', line 65 def initialize(runtime_args, = {}) @args = runtime_args parse!(@args, ) # Derive source and destination paths. @source_root = [:source] || File.join(spec.path, 'templates') if [:destination] @destination_root = [:destination] elsif defined? Sprout::Sprout.project_path @destination_root = Sprout::Sprout.project_path else @destination_root = Dir.pwd end # Silence the logger if requested. logger.quiet = [:quiet] # Raise usage error if help is requested. usage if [:help] end |