Class: Omniauth::Rails::Configurator
- Inherits:
-
Object
- Object
- Omniauth::Rails::Configurator
- Defined in:
- lib/omniauth/rails/configurator.rb
Constant Summary collapse
- REQUIRED_SETTINGS =
%i(providers authenticated_root).freeze
Class Method Summary collapse
Instance Method Summary collapse
- #configure ⇒ Object
-
#initialize(data) ⇒ Configurator
constructor
A new instance of Configurator.
Constructor Details
#initialize(data) ⇒ Configurator
Returns a new instance of Configurator.
21 22 23 |
# File 'lib/omniauth/rails/configurator.rb', line 21 def initialize(data) @data = data end |
Class Method Details
.default_config_file ⇒ Object
7 8 9 |
# File 'lib/omniauth/rails/configurator.rb', line 7 def self.default_config_file "#{::Rails.root}/config/omniauth_rails.yml" end |
.from_default_config_file ⇒ Object
11 12 13 14 15 |
# File 'lib/omniauth/rails/configurator.rb', line 11 def self.from_default_config_file ::Rails.logger.info "Omniauth::Rails::Configurator: Loading from " \ "default_config_file=#{default_config_file}" from_yaml(default_config_file) end |
.from_yaml(file) ⇒ Object
17 18 19 |
# File 'lib/omniauth/rails/configurator.rb', line 17 def self.from_yaml(file) new(YAML.load(ERB.new(File.read(file)).result)[::Rails.env]) end |
Instance Method Details
#configure ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/omniauth/rails/configurator.rb', line 25 def configure validate! configure_omni_auth_settings configure_providers Configuration.automount = automount Configuration.authenticated_root = authenticated_root Configuration.unauthenticated_root = unauthenticated_root Configuration.include_concern_in_application_controller = include_concern_in_application_controller Configuration.session_duration = session_duration.seconds if session_duration.present? Configuration.extra_keys_to_store_in_session = extra_keys_to_store_in_session Configuration.dev_mode = dev_mode end |