Class: DeviseLdapAuthenticatable::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- DeviseLdapAuthenticatable::InstallGenerator
- Defined in:
- lib/generators/devise_ldap_authenticatable/install_generator.rb
Instance Method Summary collapse
- #create_default_devise_settings ⇒ Object
- #create_ldap_config ⇒ Object
- #update_application_controller ⇒ Object
- #update_user_model ⇒ Object
Instance Method Details
#create_default_devise_settings ⇒ Object
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_config ⇒ Object
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_controller ⇒ Object
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 .add_rescue? end |
#update_user_model ⇒ Object
19 20 21 |
# File 'lib/generators/devise_ldap_authenticatable/install_generator.rb', line 19 def update_user_model gsub_file "app/models/#{.user_model}.rb", /:database_authenticatable/, ":ldap_authenticatable" if .update_model? end |