Sha256: 27873612655bbfde1cc5c6f7bfc58707575a48fa9569b0ad90859da6a0464407

Contents?: true

Size: 796 Bytes

Versions: 2

Compression:

Stored size: 796 Bytes

Contents

# frozen_string_literal: true

module DeviseSecurity
  module Generators
    # Generator for Rails to create or append to a Devise initializer.
    class InstallGenerator < Rails::Generators::Base
      LOCALES = %w[by cs de en es fa fr hi it ja nl pt ru tr uk zh_CN zh_TW].freeze

      source_root File.expand_path('../../templates', __FILE__)
      desc 'Install the devise security extension'

      def copy_initializer
        template('devise_security.rb',
                 'config/initializers/devise_security.rb',
        )
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-security-0.17.0 lib/generators/devise_security/install_generator.rb
devise-security-0.16.0 lib/generators/devise_security/install_generator.rb