lib/passport.rb in passport-0.0.1 vs lib/passport.rb in passport-0.1.1
- old
+ new
@@ -1,38 +1,22 @@
-require 'active_record'
-require "rubygems"
+require 'rubygems'
+require 'active_support'
+require 'active_support/core_ext'
+require 'rack'
+require 'json'
+require 'yaml'
require 'oauth'
require 'oauth2'
-this = File.dirname(__FILE__)
+this = File.expand_path(File.dirname(__FILE__))
library = "#{this}/passport"
-require "#{this}/open_id_authentication"
-require "#{library}/ext"
-require "#{library}/passport"
-require "#{library}/callback_filter"
-require "#{library}/access_token"
-require "#{library}/openid"
-require "#{library}/oauth"
-require "#{library}/common"
+Dir["#{library}/helpers/*"].each { |file| require file }
+Dir["#{library}/core/*"].each { |file| require file }
+
+require "#{library}/openid/protocol"
require "#{library}/engine" if defined?(Rails) && Rails::VERSION::MAJOR == 3
-custom_models = ["#{library}/access_token"]
-custom_models += Dir["#{library}/oauth/tokens"]
-custom_models += Dir["#{library}/openid/tokens"]
+# require "#{library}/openid"
+require "#{library}/passport"
-# Rails 3/2 config
-load_path_method = ActiveSupport::Dependencies.respond_to?(:autoload_paths) ? :autoload_paths : :load_paths
-
-custom_models.each do |path|
- $LOAD_PATH << path
- ActiveSupport::Dependencies.send(load_path_method) << path
-end
-
-# Rails 3beta4 backport
-if defined?(ActiveSupport::HashWithIndifferentAccess)
- ActiveSupport::HashWithIndifferentAccess.class_eval do
- def symbolize_keys!
- symbolize_keys
- end
- end
-end
+Passport.root = "#{this}/.."
\ No newline at end of file