Class: DeviseLdapAuthenticatable::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_default_devise_settingsObject



15
16
17
# File 'lib/generators/devise_ldap_authenticatable/install_generator.rb', line 15

def create_default_devise_settings
  inject_into_file "config/initializers/devise.rb", default_devise_settings, :after => "Devise.setup do |config|\n"   
end

#create_ldap_configObject



11
12
13
# File 'lib/generators/devise_ldap_authenticatable/install_generator.rb', line 11

def create_ldap_config
  copy_file "ldap.yml", "config/ldap.yml"
end

#update_application_controllerObject



23
24
25
# File 'lib/generators/devise_ldap_authenticatable/install_generator.rb', line 23

def update_application_controller
  inject_into_class "app/controllers/application_controller.rb", ApplicationController, rescue_from_exception if options.add_rescue?
end

#update_user_modelObject



19
20
21
# File 'lib/generators/devise_ldap_authenticatable/install_generator.rb', line 19

def update_user_model
  gsub_file "app/models/#{options.user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable" if options.update_model?
end