Class: Genesis::ContextsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Genesis::ContextsGenerator
- Defined in:
- lib/generators/genesis/contexts/contexts_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
11 12 13 14 |
# File 'lib/generators/genesis/contexts/contexts_generator.rb', line 11 def self.source_root File.join File.dirname(__FILE__), 'templates' end |
Instance Method Details
#install_contexts ⇒ Object
16 17 18 19 20 |
# File 'lib/generators/genesis/contexts/contexts_generator.rb', line 16 def install_contexts normalized_contexts.each do |context| empty_directory File.join( Genesis::SEEDS_ROOT, 'contexts', context ) end end |
#normalized_contexts ⇒ Object
22 23 24 25 26 |
# File 'lib/generators/genesis/contexts/contexts_generator.rb', line 22 def normalized_contexts return contexts if contexts.is_a?( Array ) contexts.split ',' end |