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
19
20
# 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 'devise.rb', 'config/initializers/devise.rb'

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

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

#insert_engine_routesObject



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

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



28
29
30
# File 'lib/generators/locomotive/install/install_generator.rb', line 28

def remove_index_html
  remove_file 'public/index.html'
end

#show_readmeObject



32
33
34
# File 'lib/generators/locomotive/install/install_generator.rb', line 32

def show_readme
  readme 'README'
end