Class: Polivalente::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/polivalente/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_devise_i18n_gemObject



23
24
25
# File 'lib/generators/polivalente/install/install_generator.rb', line 23

def add_devise_i18n_gem
  gem 'devise-i18n'
end

#add_routeObject



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_initializerObject



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_initializerObject



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_migrationsObject



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_readmeObject



27
28
29
# File 'lib/generators/polivalente/install/install_generator.rb', line 27

def show_readme
  readme "README" if behavior == :invoke
end