facebook_graphr 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{facebook_graphr}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kevin Ball"]
12
- s.date = %q{2010-08-27}
12
+ s.date = %q{2010-08-30}
13
13
  s.description = %q{A lightweight gem for dealing with Facebook's new Open Graph API}
14
14
  s.email = %q{kmball11@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  "facebook_graphr.gemspec",
27
27
  "init.rb",
28
28
  "lib/facebook_graphr.rb",
29
+ "lib/facebook_graphr/controller.rb",
29
30
  "lib/facebook_graphr/helpers.rb",
30
31
  "rails/init.rb",
31
32
  "test/helper.rb",
data/init.rb CHANGED
@@ -1 +1,5 @@
1
1
  require 'facebook_graphr'
2
+ if defined?(Rails)
3
+ require 'facebook_graphr/controller'
4
+ require 'facebook_graphr/helpers'
5
+ end
@@ -0,0 +1,16 @@
1
+ module FacebookGraphr
2
+ module Rails
3
+ module Controller
4
+ def self.included(controller)
5
+ controller.helper_method :facebook_graph_session
6
+ end
7
+
8
+ def facebook_graph_session
9
+ @facebook_graph_session ||= begin
10
+ cookie = cookies["fbs_#{FacebookGraphr.config[:app_id]}"]
11
+ FacebookGraphr::Session.new_from_cookie(cookie) if cookie
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -23,5 +23,13 @@ module FacebookGraphr
23
23
  EOS
24
24
  end
25
25
  end
26
+ module FBML
27
+ # can have size => :thumb, :small, :normal, and :square
28
+ # :linked => true/false
29
+ def facebook_profile_pic(fbuid, options = {})
30
+ options = options.dup
31
+ content_tag("fb:profile-pick", nil, options.merge(:uid => fbuid))
32
+ end
33
+ end
26
34
  end
27
35
  end
@@ -8,7 +8,7 @@ module FacebookGraphr
8
8
  YAML::load(f)
9
9
  end
10
10
  self.config = if defined?(Rails)
11
- hash[Rails.env].symbolize_keys
11
+ hash[::Rails.env].symbolize_keys
12
12
  else
13
13
  hash.symbolize_keys
14
14
  end
@@ -19,7 +19,7 @@ module FacebookGraphr
19
19
  attr_accessor :api_key, :app_id, :user_id, :access_token, :secret_key
20
20
 
21
21
  def self.new_from_cookie(cookie)
22
- Rails.logger.info(cookie.inspect)
22
+ ::Rails.logger.info(cookie.inspect)
23
23
  cookie_hash = cookie.split("&").inject({}) do |hash, pair|
24
24
  k, v = pair.split('=')
25
25
  hash.merge(k.to_sym => v)
data/rails/init.rb CHANGED
@@ -1 +1,5 @@
1
+ require File.join(File.dirname(__FILE__),'../init.rb')
1
2
  ActionController::Base.send(:helper, FacebookGraphr::Helpers::Init)
3
+ ActionController::Base.send(:include, FacebookGraphr::Helpers::FBML)
4
+ ActionController::Base.send(:helper, FacebookGraphr::Helpers::FBML)
5
+ ActionController::Base.send(:include, FacebookGraphr::Rails::Controller)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_graphr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kevin Ball
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-27 00:00:00 -07:00
18
+ date: 2010-08-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -51,6 +51,7 @@ files:
51
51
  - facebook_graphr.gemspec
52
52
  - init.rb
53
53
  - lib/facebook_graphr.rb
54
+ - lib/facebook_graphr/controller.rb
54
55
  - lib/facebook_graphr/helpers.rb
55
56
  - rails/init.rb
56
57
  - test/helper.rb