Class: Devise::SecurePassword::Generators::InstallGenerator

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

Constant Summary collapse

LOCALES =
%w(en).freeze

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



13
14
15
# File 'lib/generators/devise/secure_password/install_generator.rb', line 13

def copy_initializer
  template 'secure_password.rb', 'config/initializers/secure_password.rb'
end

#copy_localeObject



17
18
19
20
21
22
# File 'lib/generators/devise/secure_password/install_generator.rb', line 17

def copy_locale
  LOCALES.each do |locale|
    copy_file "../../../../config/locales/#{locale}.yml",
              "config/locales/secure_password.#{locale}.yml"
  end
end

#show_readmeObject



24
25
26
# File 'lib/generators/devise/secure_password/install_generator.rb', line 24

def show_readme
  readme 'README.txt' if behavior == :invoke
end