Class: Rack::Auth::Config
- Inherits:
-
Object
- Object
- Rack::Auth::Config
- Defined in:
- lib/rack/auth/ldap.rb
Overview
Note:
this class is not provide to be used standalone
class Config provide Yaml config mapping for Rack::Auth::Module the class map ldap configurations values
Instance Method Summary collapse
-
#initialize(options = { :file => './ldap.yml'}) ⇒ Config
constructor
initializer for Config class.
Constructor Details
#initialize(options = { :file => './ldap.yml'}) ⇒ Config
initializer for Config class
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rack/auth/ldap.rb', line 27 def initialize( = { :file => './ldap.yml'}) @values = defaults .merge!(:file => './ldap.yml') { |key,oldval,newval| oldval } target = (ENV['RACK_ENV'])? ENV['RACK_ENV'] : 'test' config_values = load_yaml(::File.([:file], Dir.pwd))[target] debug = ::File.open("/tmp/test.txt",'a+') debug.puts ENV['RACK_ENV'] debug.close config_values.keys.each do |key| config_values[key.to_sym] = config_values.delete(key) end @values.merge! config_values @values.keys.each do |meth| bloc = Proc.new {@values[meth] } self.class.send :define_method, meth, &bloc end end |