fb_graph 2.2.0.alpha2 → 2.2.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -2
- data/Rakefile +2 -7
- data/VERSION +1 -1
- data/lib/fb_graph/album.rb +1 -0
- data/lib/fb_graph/checkin.rb +1 -0
- data/lib/fb_graph/comment.rb +1 -0
- data/lib/fb_graph/connections/likes.rb +7 -5
- data/lib/fb_graph/link.rb +1 -0
- data/lib/fb_graph/node.rb +9 -12
- data/lib/fb_graph/note.rb +1 -0
- data/lib/fb_graph/open_graph/action.rb +1 -0
- data/lib/fb_graph/page.rb +1 -0
- data/lib/fb_graph/photo.rb +1 -0
- data/lib/fb_graph/post.rb +1 -0
- data/lib/fb_graph/status.rb +1 -0
- data/lib/fb_graph/user.rb +1 -0
- data/lib/fb_graph/user_achievement.rb +1 -0
- data/lib/fb_graph/video.rb +1 -0
- data/spec/fb_graph/{query/core_spec.rb → query_spec.rb} +1 -1
- data/spec/helpers/webmock_helper.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +18 -18
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fb_graph (2.2.0.
|
4
|
+
fb_graph (2.2.0.alpha2)
|
5
5
|
httpclient (>= 2.2.0.2)
|
6
6
|
rack-oauth2 (>= 0.9.4)
|
7
7
|
|
@@ -44,7 +44,6 @@ GEM
|
|
44
44
|
jruby-openssl (0.7.4)
|
45
45
|
bouncy-castle-java
|
46
46
|
json (1.6.1)
|
47
|
-
json (1.6.1-java)
|
48
47
|
multi_json (1.0.3)
|
49
48
|
rack (1.3.5)
|
50
49
|
rack-cache (1.1)
|
data/Rakefile
CHANGED
@@ -6,13 +6,8 @@ RSpec::Core::RakeTask.new(:spec)
|
|
6
6
|
|
7
7
|
if RUBY_VERSION >= '1.9'
|
8
8
|
require 'cover_me'
|
9
|
-
|
10
|
-
CoverMe.config
|
11
|
-
c.file_pattern = /(#{CoverMe.config.project.root}\/lib\/.+\.rb)/i
|
12
|
-
end
|
13
|
-
at_exit do
|
14
|
-
CoverMe.complete!
|
15
|
-
end
|
9
|
+
CoverMe.config do |c|
|
10
|
+
c.file_pattern = /(#{CoverMe.config.project.root}\/lib\/.+\.rb)/i
|
16
11
|
end
|
17
12
|
else
|
18
13
|
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.0.
|
1
|
+
2.2.0.beta
|
data/lib/fb_graph/album.rb
CHANGED
@@ -3,6 +3,7 @@ module FbGraph
|
|
3
3
|
include Connections::Photos
|
4
4
|
include Connections::Comments
|
5
5
|
include Connections::Likes
|
6
|
+
include Connections::Likes::Likable
|
6
7
|
include Connections::Picture
|
7
8
|
|
8
9
|
attr_accessor :from, :name, :description, :location, :link, :cover_photo, :privacy, :count, :type, :created_time, :updated_time
|
data/lib/fb_graph/checkin.rb
CHANGED
data/lib/fb_graph/comment.rb
CHANGED
@@ -19,12 +19,14 @@ module FbGraph
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
module Likable
|
23
|
+
def like!(options = {})
|
24
|
+
post(options.merge(:connection => :likes))
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
def unlike!(options = {})
|
28
|
+
destroy(options.merge(:connection => :likes))
|
29
|
+
end
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/fb_graph/link.rb
CHANGED
data/lib/fb_graph/node.rb
CHANGED
@@ -114,19 +114,16 @@ module FbGraph
|
|
114
114
|
when 'null'
|
115
115
|
nil
|
116
116
|
else
|
117
|
-
# NOTE: User#app_request! returns ID as a JSON string not as a JSON object..
|
118
117
|
if response.body.gsub('"', '').to_i.to_s == response.body.gsub('"', '')
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
Exception.handle_httpclient_error(_response_, response.headers) if _response_[:error]
|
129
|
-
_response_
|
118
|
+
# NOTE: User#app_request! returns ID as a JSON string not as a JSON object..
|
119
|
+
response.body.gsub('"', '')
|
120
|
+
else
|
121
|
+
_response_ = JSON.parse(response.body).with_indifferent_access
|
122
|
+
if (200...300).include?(response.status)
|
123
|
+
_response_
|
124
|
+
else
|
125
|
+
Exception.handle_httpclient_error(_response_, response.headers)
|
126
|
+
end
|
130
127
|
end
|
131
128
|
end
|
132
129
|
rescue JSON::ParserError
|
data/lib/fb_graph/note.rb
CHANGED
data/lib/fb_graph/page.rb
CHANGED
data/lib/fb_graph/photo.rb
CHANGED
data/lib/fb_graph/post.rb
CHANGED
@@ -3,6 +3,7 @@ module FbGraph
|
|
3
3
|
include Connections::Comments
|
4
4
|
include Connections::Insights
|
5
5
|
include Connections::Likes
|
6
|
+
include Connections::Likes::Likable
|
6
7
|
extend Searchable
|
7
8
|
|
8
9
|
attr_accessor :from, :to, :with_tags, :message, :message_tags, :picture, :link, :name, :caption, :description, :source, :properties, :icon, :actions, :privacy, :type, :graph_object_id, :application, :targeting, :created_time, :updated_time, :story, :story_tags
|
data/lib/fb_graph/status.rb
CHANGED
data/lib/fb_graph/user.rb
CHANGED
data/lib/fb_graph/video.rb
CHANGED
@@ -2,6 +2,7 @@ module FbGraph
|
|
2
2
|
class Video < Node
|
3
3
|
include Connections::Comments
|
4
4
|
include Connections::Likes
|
5
|
+
include Connections::Likes::Likable
|
5
6
|
include Connections::Picture
|
6
7
|
|
7
8
|
attr_accessor :from, :tags, :name, :description, :embed_html, :icon, :source, :created_time, :updated_time
|
@@ -29,7 +29,7 @@ describe FbGraph::Query do
|
|
29
29
|
mock_fql raw_query, 'query/user/with_invalid_token', :access_token => 'invalid', :status => [400, 'Bad Request'] do
|
30
30
|
lambda do
|
31
31
|
query.fetch('invalid')
|
32
|
-
end.should raise_error
|
32
|
+
end.should raise_error FbGraph::Exception
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -28,7 +28,7 @@ module WebMockHelper
|
|
28
28
|
stub_request(:get, FbGraph::Query.new(query).endpoint).with(
|
29
29
|
request_for(:get, options)
|
30
30
|
).to_return(
|
31
|
-
response_for(response_file)
|
31
|
+
response_for(response_file, options)
|
32
32
|
)
|
33
33
|
res = yield
|
34
34
|
a_request(:get, FbGraph::Query.new(query).endpoint).with(
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.0.
|
4
|
+
version: 2.2.0.beta
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-08 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
16
|
-
requirement: &
|
16
|
+
requirement: &70282942842620 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.2.0.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70282942842620
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rack-oauth2
|
27
|
-
requirement: &
|
27
|
+
requirement: &70282942840260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.9.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70282942840260
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70282942837740 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.8'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70282942837740
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: cover_me
|
49
|
-
requirement: &
|
49
|
+
requirement: &70282942835880 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.2.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70282942835880
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &70282942834140 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '2'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70282942834140
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
|
-
requirement: &
|
71
|
+
requirement: &70282942833180 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.6.2
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70282942833180
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: actionpack
|
82
|
-
requirement: &
|
82
|
+
requirement: &70282942819620 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: 3.0.6
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70282942819620
|
91
91
|
description: A full-stack Facebook Graph API wrapper in Ruby.
|
92
92
|
email: nov@matake.jp
|
93
93
|
executables: []
|
@@ -368,7 +368,7 @@ files:
|
|
368
368
|
- spec/fb_graph/post_spec.rb
|
369
369
|
- spec/fb_graph/privacy_spec.rb
|
370
370
|
- spec/fb_graph/project_spec.rb
|
371
|
-
- spec/fb_graph/
|
371
|
+
- spec/fb_graph/query_spec.rb
|
372
372
|
- spec/fb_graph/reach_estimate_spec.rb
|
373
373
|
- spec/fb_graph/searchable_spec.rb
|
374
374
|
- spec/fb_graph/seriarization_spec.rb
|
@@ -703,7 +703,7 @@ test_files:
|
|
703
703
|
- spec/fb_graph/post_spec.rb
|
704
704
|
- spec/fb_graph/privacy_spec.rb
|
705
705
|
- spec/fb_graph/project_spec.rb
|
706
|
-
- spec/fb_graph/
|
706
|
+
- spec/fb_graph/query_spec.rb
|
707
707
|
- spec/fb_graph/reach_estimate_spec.rb
|
708
708
|
- spec/fb_graph/searchable_spec.rb
|
709
709
|
- spec/fb_graph/seriarization_spec.rb
|