Class: Locomotive::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializersObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/locomotive/install/install_generator.rb', line 6

def copy_initializers
  @source_paths = nil # reset it for the find_in_source_paths method

  Locomotive::InstallGenerator.source_root(File.expand_path('../templates', __FILE__))

  template 'locomotive.rb', 'config/initializers/locomotive.rb'

  template 'carrierwave.rb', 'config/initializers/carrierwave.rb'

  template 'dragonfly.rb', 'config/initializers/dragonfly.rb'

  template 'mongoid.yml', 'config/mongoid.yml'
end

#insert_engine_routesObject



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

def insert_engine_routes
  route %(
  mount Locomotive::Engine => '/locomotive', :as => 'locomotive' # you can change the value of the path, by default set to "/locomotive"
  )
end

#remove_index_htmlObject



26
27
28
# File 'lib/generators/locomotive/install/install_generator.rb', line 26

def remove_index_html
  remove_file 'public/index.html'
end

#show_readmeObject



30
31
32
# File 'lib/generators/locomotive/install/install_generator.rb', line 30

def show_readme
  readme 'README'
end