2010-06-12 01:13:58 +00:00
|
|
|
module Locomotive
|
|
|
|
class InstallGenerator < Rails::Generators::Base
|
|
|
|
|
2010-12-16 12:39:05 +00:00
|
|
|
source_root File.expand_path('../../../../../', __FILE__)
|
|
|
|
|
|
|
|
def copy_mongoid_config
|
|
|
|
copy_file 'config/mongoid.yml', 'config/mongoid.yml'
|
2010-06-12 01:13:58 +00:00
|
|
|
end
|
|
|
|
|
2010-12-16 12:39:05 +00:00
|
|
|
def copy_assets
|
2010-12-16 23:42:38 +00:00
|
|
|
directory 'public', 'public', :recursive => true
|
|
|
|
copy_file 'config/assets.yml', 'config/assets.yml'
|
|
|
|
end
|
|
|
|
|
|
|
|
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__))
|
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
template 'locomotive.rb', 'config/initializers/locomotive.rb'
|
2011-04-06 23:34:36 +00:00
|
|
|
|
|
|
|
template 'carrierwave.rb', 'config/initializers/carrierwave.rb'
|
2011-06-20 19:05:12 +00:00
|
|
|
|
|
|
|
template 'dragonfly.rb', 'config/initializers/dragonfly.rb'
|
2010-07-13 00:46:17 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-12-16 12:39:05 +00:00
|
|
|
def remove_index_html
|
|
|
|
remove_file 'public/index.html'
|
2010-07-13 00:46:17 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-13 00:46:17 +00:00
|
|
|
def show_readme
|
|
|
|
readme 'README'
|
2010-06-12 01:13:58 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|