lib/generators/lentil/install_generator.rb in lentil-0.1.7 vs lib/generators/lentil/install_generator.rb in lentil-0.1.8
- old
+ new
@@ -6,10 +6,25 @@
desc 'remove public/index.html'
def remove_public_index
remove_file('public/index.html')
end
+ desc 'insert lentil config comments'
+ def lentil_config_comments
+ insert_into_file "config/application.rb", "\n # Inserted by lentil\n # End of lentil changes\n\n", :after => "class Application < Rails::Application\n"
+ end
+
+ desc 'precompile additional assets'
+ def precompile_assets
+ insert_into_file "config/application.rb", " config.assets.precompile += %w( lentil/iframe.js lentil/iframe.css )\n", :after => "# Inserted by lentil\n"
+ end
+
+ desc 'do not enforce available locales'
+ def set_enforce_available_locales
+ insert_into_file "config/application.rb", " I18n.enforce_available_locales = true\n", :after => "# Inserted by lentil\n"
+ end
+
desc 'install migrations'
def install_migrations
rake "lentil:install:migrations"
rake "db:migrate"
end
@@ -18,12 +33,12 @@
def load_seeds
append_to_file 'db/seeds.rb', "\nLentil::Engine.load_seed\n"
rake "db:seed"
end
- desc 'create devise initializer'
- def create_devise_initializer
- copy_file 'devise.rb', 'config/initializers/devise.rb'
+ desc 'install_devise_files'
+ def install_devise_files
+ generate 'devise:install'
end
desc 'install active_admin'
def install_active_admin
copy_file 'active_admin.rb', 'config/initializers/active_admin.rb'