engine/lib/generators/locomotive/install/install_generator.rb

36 lines
924 B
Ruby
Raw Permalink Normal View History

module Locomotive
class InstallGenerator < Rails::Generators::Base
2010-12-16 12:39:05 +00:00
source_root File.expand_path('../../../../../', __FILE__)
def copy_initializers
2010-12-16 12:39:05 +00:00
@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'
2011-04-06 23:34:36 +00:00
template 'carrierwave.rb', 'config/initializers/carrierwave.rb'
template 'dragonfly.rb', 'config/initializers/dragonfly.rb'
template 'mongoid.yml', 'config/mongoid.yml'
end
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
2010-12-16 12:39:05 +00:00
def remove_index_html
remove_file 'public/index.html'
end
def show_readme
readme 'README'
end
end
end