Class: Genesis::ContextsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/genesis/contexts/contexts_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



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_contextsObject



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_contextsObject



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