Class: DeviseGoogleAuthenticator::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- DeviseGoogleAuthenticator::Generators::InstallGenerator
- Defined in:
- lib/generators/devise_google_authenticator/install_generator.rb
Overview
Install Generator
Instance Method Summary collapse
Instance Method Details
#add_configs ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/generators/devise_google_authenticator/install_generator.rb', line 9 def add_configs inject_into_file "config/initializers/devise.rb", "\n # ==> Devise Google Authenticator Extension\n # Configure extension for devise\n\n" + " # How long should the user have to enter their token. To change the default, uncomment and change the below:\n" + " # config.ga_timeout = 3.minutes\n\n" + " # Change time drift settings for valid token values. To change the default, uncomment and change the below:\n" + " # config.ga_timedrift = 3\n\n" + "\n", :before => /end[ |\n|]+\Z/ end |
#copy_locale ⇒ Object
18 19 20 |
# File 'lib/generators/devise_google_authenticator/install_generator.rb', line 18 def copy_locale copy_file "../../../config/locales/en.yml", "config/locales/devise.google_authenticator.en.yml" end |