lib/authlogic-connect.rb in authlogic-connect-0.0.3.2 vs lib/authlogic-connect.rb in authlogic-connect-0.0.3.3
- old
+ new
@@ -1,53 +1,15 @@
require 'active_record'
require 'authlogic'
require 'oauth'
require 'oauth2'
-
-# Throw callback rack app into the middleware stack
-# TODO: Somehow do this for Rails 3?
-# For now it is in the sample Rails 3 app
-=begin
-ActionController::Dispatcher.middleware = ActionController::MiddlewareStack.new do |m|
- ActionController::Dispatcher.middleware.each do |klass|
- m.use klass
- end
- m.use AuthlogicConnect::CallbackFilter
-end
-=end
this = File.dirname(__FILE__)
library = "#{this}/authlogic_connect"
-class Hash
- def recursively_symbolize_keys!
- self.symbolize_keys!
- self.values.each do |v|
- if v.is_a? Hash
- v.recursively_symbolize_keys!
- elsif v.is_a? Array
- v.recursively_symbolize_keys!
- end
- end
- self
- end
-end
-
-class Array
- def recursively_symbolize_keys!
- self.each do |item|
- if item.is_a? Hash
- item.recursively_symbolize_keys!
- elsif item.is_a? Array
- item.recursively_symbolize_keys!
- end
- end
- end
-end
-
module AuthlogicConnect
- VERSION = "0.0.1"
+ KEY = "connect"
class << self
attr_accessor :config
@@ -61,18 +23,18 @@
path.to_s.split(".").each { |node| result = result[node.to_sym] if result }
result
end
def credentials(service)
- key("services.#{service.to_s}")
+ key("#{KEY}.#{service.to_s}")
end
def services
- key("services")
+ key(KEY)
end
def service_names
- key("services").keys.collect(&:to_s)
+ services.keys.collect(&:to_s)
end
def include?(service)
!credentials(service).nil?
end
\ No newline at end of file