Sha256: d1fd52f9217e2578caa07b2ea3c842024ba8558c8dcd694427a47aeffd247d44
Contents?: true
Size: 1.73 KB
Versions: 2
Compression:
Stored size: 1.73 KB
Contents
module DeviseSafeguard module Generators # Install Generator class InstallGenerator < Rails::Generators::Base source_root File.expand_path("../../templates", __FILE__) class_option :haml, :type => :boolean, :required => false, :default => false, :desc => "Generate views in Haml" class_option :sass, :type => :boolean, :required => false, :default => false, :desc => "Generate stylesheet in Sass" desc "Install the devise safeguard extension" def add_configs inject_into_file "config/initializers/devise.rb", "\n" + " # ==> Devise Safeguard Authentication Extension\n" + " # How long should the user's device be remembered for.\n" + " # config.safeguard_remember_device = 1.month\n\n", :before => /^end[\r\n]*$/ end def copy_locale copy_file "../../../config/locales/pt-BR.yml", "config/locales/devise.safeguard.pt-BR.yml" copy_file "../../../config/locales/en.yml", "config/locales/devise.safeguard.en.yml" end def copy_views if options.haml? copy_file '../../../app/views/devise/verify_safeguard.html.haml', 'app/views/devise/devise_safeguard/verify_safeguard.html.haml' else copy_file '../../../app/views/devise/verify_safeguard.html.erb', 'app/views/devise/devise_safeguard/verify_safeguard.html.erb' end end def copy_assets if options.sass? copy_file '../../../app/assets/stylesheets/devise_safeguard.sass', 'app/assets/stylesheets/devise_safeguard.sass' else copy_file '../../../app/assets/stylesheets/devise_safeguard.css', 'app/assets/stylesheets/devise_safeguard.css' end end def inject_assets_in_layout end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
safeguard-devise-0.0.3 | lib/generators/devise_safeguard/install_generator.rb |
safeguard-devise-0.0.2 | lib/generators/devise_safeguard/install_generator.rb |