Class: Genesis::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



11
12
13
14
# File 'lib/generators/genesis/install/install_generator.rb', line 11

def self.source_root
  File.join File.dirname(__FILE__),
            'templates'
end

Instance Method Details

#envsObject



21
22
23
24
25
# File 'lib/generators/genesis/install/install_generator.rb', line 21

def envs
  return environments if environments.is_a?( Array )

  environments.split ','
end

#install_seedingObject



16
17
18
19
# File 'lib/generators/genesis/install/install_generator.rb', line 16

def install_seeding
  envs.each { |env| empty_directory "db/seeds/#{env}" }
  copy_file 'genesis_callbacks.rb', 'db/seeds/genesis_callbacks.rb'
end