Sha256: 9a5f9add165c814d3ede8ffe7bb1b3ff0f6a36028d74406e3ee9d90602c5bca2

Contents?: true

Size: 796 Bytes

Versions: 18

Compression:

Stored size: 796 Bytes

Contents

# config/initializers/koala.rb
# Monkey-patch in Facebook config so Koala knows to
# automatically use Facebook settings from here if none are given

module Facebook
  CONFIG = YAML.load(ERB.new(File.read("#{RAILS_ROOT}/config/facebook.yml")).result)[RAILS_ENV]
  APP_ID = CONFIG['app_id']
  SECRET = CONFIG['secret_key']
end

Koala::Facebook::OAuth.class_eval do
  def initialize_with_default_settings(*args)
    case args.size
    when 0, 1
      raise "application id and/or secret are not specified in the config" unless Facebook::APP_ID && Facebook::SECRET
      initialize_without_default_settings(Facebook::APP_ID.to_s, Facebook::SECRET.to_s, args.first)
    when 2, 3
      initialize_without_default_settings(*args)
    end
  end

  alias_method_chain :initialize, :default_settings
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rails3-generators-0.17.4 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.17.3 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.17.2 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.17.1 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.17.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.16.1 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.16.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.15.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.14.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.13.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.12.1 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.12.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.11.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.10.3 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.10.2 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.10.1 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.10.0 lib/generators/koala/install/templates/config/initializers/koala.rb.tt
rails3-generators-0.9.2 lib/generators/koala/install/templates/config/initializers/koala.rb.tt