used Kernel#autoload to reduce memory footprint when only requiring parts of OmniAuth
This commit is contained in:
Родитель
353f4085d4
Коммит
5973843611
|
@ -1,5 +1,10 @@
|
|||
require 'omniauth/core'
|
||||
require 'omniauth/strategies/http_basic'
|
||||
|
||||
require 'omniauth/strategies/campfire'
|
||||
require 'omniauth/strategies/basecamp'
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
autoload :HttpBasic, 'omniauth/strategies/http_basic'
|
||||
autoload :Basecamp, 'omniauth/strategies/basecamp'
|
||||
autoload :Campfire, 'omniauth/strategies/campfire'
|
||||
# autoload :Gowalla, 'omniauth/strategies/gowalla'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'omniauth/basic'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
class Basecamp < HttpBasic
|
||||
|
@ -50,4 +52,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'omniauth/basic'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
class Campfire < HttpBasic
|
||||
|
@ -42,4 +44,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
# so this won't actually work at all it
|
||||
# turns out.
|
||||
|
||||
# require 'omniauth/basic'
|
||||
#
|
||||
# module OmniAuth
|
||||
# module Strategies
|
||||
# class Gowalla < OmniAuth::Strategies::HttpBasic #:nodoc:
|
||||
|
@ -14,4 +16,4 @@
|
|||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'restclient'
|
||||
require 'omniauth/basic'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -53,4 +54,3 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
require 'omniauth/core'
|
||||
|
||||
module OmniAuth
|
||||
class Builder < Rack::Builder
|
||||
def initialize(app, &block)
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
require 'rack'
|
||||
require 'singleton'
|
||||
|
||||
require 'omniauth/form'
|
||||
|
||||
module OmniAuth
|
||||
|
||||
autoload :Builder, 'omniauth/builder'
|
||||
autoload :Strategy, 'omniauth/strategy'
|
||||
|
||||
module Strategies
|
||||
autoload :Password, 'omniauth/strategies/password'
|
||||
end
|
||||
|
||||
class Configuration
|
||||
include Singleton
|
||||
|
||||
|
@ -85,6 +92,3 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
require 'omniauth/builder'
|
||||
require 'omniauth/strategy'
|
|
@ -1,3 +1,5 @@
|
|||
require 'omniauth/core'
|
||||
|
||||
module OmniAuth
|
||||
class Form
|
||||
DEFAULT_CSS = <<-CSS
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
require 'omniauth/core'
|
||||
require 'omniauth/strategies/password'
|
|
@ -1,4 +1,6 @@
|
|||
require 'digest/sha1'
|
||||
require 'omniauth/core'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
class Password
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
require 'omniauth/core'
|
||||
|
||||
module OmniAuth
|
||||
|
||||
module Strategy
|
||||
|
||||
def self.included(base)
|
||||
base.class_eval do
|
||||
attr_reader :app, :name, :env
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require File.dirname(__FILE__) + '/../../spec_helper'
|
||||
require 'omniauth/password'
|
||||
|
||||
describe OmniAuth::Strategies::Password do
|
||||
|
||||
end
|
||||
it 'should exist' do
|
||||
# do nothing
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
require 'oauth'
|
||||
require 'oauth2'
|
||||
|
||||
require 'omniauth/core'
|
||||
require 'omniauth/strategies/oauth'
|
||||
require 'omniauth/strategies/twitter'
|
||||
require 'omniauth/strategies/linked_in'
|
||||
require 'omniauth/strategies/oauth2'
|
||||
require 'omniauth/strategies/facebook'
|
||||
require 'omniauth/strategies/github'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
autoload :OAuth, 'omniauth/strategies/oauth'
|
||||
autoload :OAuth2, 'omniauth/strategies/oauth2'
|
||||
|
||||
autoload :Twitter, 'omniauth/strategies/twitter'
|
||||
autoload :LinkedIn, 'omniauth/strategies/linked_in'
|
||||
autoload :Facebook, 'omniauth/strategies/facebook'
|
||||
autoload :GitHub, 'omniauth/strategies/github'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'json'
|
||||
require 'omniauth/oauth'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -50,4 +51,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'json'
|
||||
require 'omniauth/oauth'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -35,4 +36,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'omniauth/core'
|
||||
require 'omniauth/strategies/oauth'
|
||||
require 'nokogiri'
|
||||
require 'omniauth/oauth'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -44,4 +43,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
require 'oauth'
|
||||
require 'omniauth/oauth'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
class OAuth
|
||||
include OmniAuth::Strategy
|
||||
|
||||
def initialize(app, name, consumer_key, consumer_secret, options = {})
|
||||
require 'oauth'
|
||||
super
|
||||
@consumer = ::OAuth::Consumer.new(consumer_key, consumer_secret, options)
|
||||
end
|
||||
|
@ -45,4 +47,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
require 'cgi'
|
||||
require 'uri'
|
||||
require 'oauth2'
|
||||
require 'omniauth/oauth'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -35,4 +37,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'omniauth/core'
|
||||
require 'omniauth/strategies/oauth'
|
||||
require 'json'
|
||||
require 'omniauth/oauth'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -45,4 +44,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,2 +1,8 @@
|
|||
require 'omniauth/core'
|
||||
require 'omniauth/strategies/open_id'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
autoload :OpenID, 'omniauth/strategies/open_id'
|
||||
autoload :Google, 'omniauth/strategies/google'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
require 'omniauth/openid'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
class Google < OmniAuth::Stratgies::OpenID
|
||||
def identifier; 'https://www.google.com/accounts/o8/id' end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'rack/openid'
|
||||
require 'omniauth/openid'
|
||||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
|
@ -120,4 +121,4 @@ module OmniAuth
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
require 'omniauth/core'
|
||||
|
||||
%w(password oauth basic openid).each do |s|
|
||||
require "omniauth/#{s}"
|
||||
end
|
||||
module OmniAuth
|
||||
autoload :OAuth, 'omniauth/oauth'
|
||||
autoload :Basic, 'omniauth/basic'
|
||||
autoload :OpenID, 'omniauth/openid'
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче