Class: DeviseSecurity::Generators::InstallGenerator

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

Overview

Generator for Rails to create or append to a Devise initializer.

Constant Summary collapse

LOCALES =
%w[en es de fr it ja tr ru nl pt].freeze

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject


12
13
14
15
16
# File 'lib/generators/devise_security/install_generator.rb', line 12

def copy_initializer
  template('devise-security.rb',
           'config/initializers/devise-security.rb',
  )
end

#copy_localesObject


18
19
20
21
22
23
24
25
# File 'lib/generators/devise_security/install_generator.rb', line 18

def copy_locales
  LOCALES.each do |locale|
    copy_file(
      "../../../config/locales/#{locale}.yml",
      "config/locales/devise.security_extension.#{locale}.yml",
    )
  end
end