Class: Polivalente::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Polivalente::Generators::InstallGenerator
- Defined in:
- lib/generators/polivalente/install/install_generator.rb
Instance Method Summary collapse
- #add_devise_i18n_gem ⇒ Object
- #add_route ⇒ Object
- #copy_ams_initializer ⇒ Object
- #copy_initializer ⇒ Object
- #copy_migrations ⇒ Object
- #show_readme ⇒ Object
Instance Method Details
#add_devise_i18n_gem ⇒ Object
23 24 25 |
# File 'lib/generators/polivalente/install/install_generator.rb', line 23 def add_devise_i18n_gem gem 'devise-i18n' end |
#add_route ⇒ Object
18 19 20 21 |
# File 'lib/generators/polivalente/install/install_generator.rb', line 18 def add_route route "mount Polivalente::Engine => ''" route "devise_for :users, path: 'auth', path_names: { sign_in: 'login', sign_out: 'logout' }" end |
#copy_ams_initializer ⇒ Object
14 15 16 |
# File 'lib/generators/polivalente/install/install_generator.rb', line 14 def copy_ams_initializer template "active_model_serializers.rb", "config/initializers/active_model_serializers.rb" end |
#copy_initializer ⇒ Object
10 11 12 |
# File 'lib/generators/polivalente/install/install_generator.rb', line 10 def copy_initializer template "polivalente.rb", "config/initializers/polivalente.rb" end |
#copy_migrations ⇒ Object
6 7 8 |
# File 'lib/generators/polivalente/install/install_generator.rb', line 6 def copy_migrations rails_command "railties:install:migrations FROM=polivalente", inline: true end |
#show_readme ⇒ Object
27 28 29 |
# File 'lib/generators/polivalente/install/install_generator.rb', line 27 def show_readme readme "README" if behavior == :invoke end |