Class: DeviseOtp::Generators::InstallGenerator

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

Overview

Install Generator

Instance Method Summary collapse

Instance Method Details

#add_configsObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/devise_otp/install_generator.rb', line 9

def add_configs

content = <<-CONTENT

  # ==> Devise OTP Extension
  # Configure OTP extension for devise

  # How long should the user have to enter their token. To change the default, uncomment and change the below:
  #config.otp_authentication_timeout = 3.minutes

  # Change time drift settings for valid token values. To change the default, uncomment and change the below:
  #config.otp_authentication_time_drift = 3
CONTENT

  inject_into_file "config/initializers/devise.rb", content, :before => /end[ |\n|]+\Z/
end

#copy_localeObject



26
27
28
# File 'lib/generators/devise_otp/install_generator.rb', line 26

def copy_locale
  copy_file "../../../config/locales/en.yml", "config/locales/devise.otp.en.yml"
end