Sha256: c15b6980bf8c23ad09c93ed3277703f00f921a3604c88b7cc1dab4b93ddeb965

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

require 'haml'
require 'omniauth/core'
require 'omniauth/oauth'

module Socialite
  autoload :ControllerSupport, 'socialite/controller_support'
  autoload :ServiceConfig, 'socialite/service_config'

  module ApiWrappers
    autoload :Facebook, 'socialite/api_wrappers/facebook'
    autoload :Twitter, 'socialite/api_wrappers/twitter'
  end

  module Controllers
    autoload :Helpers, 'socialite/controllers/helpers'
    autoload :Identities, 'socialite/controllers/identities'
    autoload :Session, 'socialite/controllers/session'
    autoload :User, 'socialite/controllers/user'
  end

  module Helpers
    autoload :Authentication, 'socialite/helpers/authentication.rb'
  end

  module Models
    autoload :Identity, 'socialite/models/identity'
    autoload :User, 'socialite/models/user'
    autoload :FacebookIdentity, 'socialite/models/facebook_identity.rb'
  end

  mattr_accessor :service_configs, :root_path, :mount_prefix
  @@service_configs = {}

  def self.generate_token
    SecureRandom.base64(15).tr('+/=lIO0', 'pqrsxyz')
  end

  def self.setup(entity = nil, &block)
    block.call self if block_given?
  end

  # config.twitter APP_KEY, APP_SECRET, :scope => ['foo', 'bar']
  def self.twitter(app_key, app_secret, options = {})
    @@service_configs[:twitter] = ServiceConfig.new(app_key, app_secret, options)
  end

  # config.facebook APP_KEY, APP_SECRET, :scope => ['foo', 'bar']
  def self.facebook(app_key, app_secret, options = {})
    @@service_configs[:facebook] = ServiceConfig.new(app_key, app_secret, options)
  end
end

require 'socialite/engine'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
socialite-0.0.1.beta2 lib/socialite.rb