fb_graph 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/README.rdoc +8 -5
- data/VERSION +1 -1
- data/lib/fb_graph/debugger.rb +10 -2
- data/spec/fb_graph/debugger_spec.rb +12 -8
- metadata +4 -4
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
A full-stack Facebook Graph API wrapper in Ruby.
|
4
4
|
|
5
|
+
{<img src="https://secure.travis-ci.org/nov/fb_graph.png" />}[http://travis-ci.org/nov/fb_graph]
|
6
|
+
{<img src="http://www.pledgie.com/campaigns/19043.png?skin_name=chrome" />}[http://www.pledgie.com/campaigns/19043]
|
7
|
+
|
5
8
|
== Installation
|
6
9
|
|
7
10
|
gem install fb_graph
|
@@ -58,7 +61,7 @@ https://github.com/nov/fb_graph/wiki
|
|
58
61
|
user.tagged
|
59
62
|
user.family
|
60
63
|
:
|
61
|
-
|
64
|
+
|
62
65
|
# Private connections requires "access_token"
|
63
66
|
FbGraph::User.new('matake').friends # => raise FbGraph::Unauthorized
|
64
67
|
user = FbGraph::User.fetch('matake', :access_token => ACCESS_TOKEN)
|
@@ -67,7 +70,7 @@ https://github.com/nov/fb_graph/wiki
|
|
67
70
|
user.friends
|
68
71
|
user.likes
|
69
72
|
:
|
70
|
-
|
73
|
+
|
71
74
|
# "home" connection is only available for "me"
|
72
75
|
me = User.new('me', :access_token => ACCESS_TOKEN)
|
73
76
|
me.home
|
@@ -79,8 +82,8 @@ specifying the field. An example for events:
|
|
79
82
|
|
80
83
|
user.events({:fields => "owner,name,description,picture"}) # { and } optional
|
81
84
|
|
82
|
-
An overview of which fields you can include in the graph API can be found at
|
83
|
-
https://developers.facebook.com/docs/reference/api/, which has a description
|
85
|
+
An overview of which fields you can include in the graph API can be found at
|
86
|
+
https://developers.facebook.com/docs/reference/api/, which has a description
|
84
87
|
of the specific objects fields in the sidebar under "Objects".
|
85
88
|
|
86
89
|
==== Search
|
@@ -275,7 +278,7 @@ See GitHub wiki for more examples.
|
|
275
278
|
https://github.com/nov/fb_graph/wiki
|
276
279
|
|
277
280
|
== Note on Patches/Pull Requests
|
278
|
-
|
281
|
+
|
279
282
|
* Fork the project.
|
280
283
|
* Make your feature addition or bug fix.
|
281
284
|
* Add tests for it. This is important so I don't break it in a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.2
|
data/lib/fb_graph/debugger.rb
CHANGED
@@ -5,7 +5,7 @@ module FbGraph
|
|
5
5
|
# request:: HTTP::Message
|
6
6
|
def filter_request(request)
|
7
7
|
started = "======= [FbGraph] API REQUEST STARTED ======="
|
8
|
-
|
8
|
+
log started, request.dump
|
9
9
|
end
|
10
10
|
|
11
11
|
# Callback called in HTTPClient (after received a response)
|
@@ -13,7 +13,15 @@ module FbGraph
|
|
13
13
|
# response:: HTTP::Message
|
14
14
|
def filter_response(request, response)
|
15
15
|
finished = "======= [FbGraph] API REQUEST FINISHED ======="
|
16
|
-
|
16
|
+
log '-' * 50, response.dump, finished
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def log(*outputs)
|
22
|
+
outputs.each do |output|
|
23
|
+
FbGraph.logger.info output
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
@@ -8,21 +8,25 @@ describe FbGraph::Debugger::RequestFilter do
|
|
8
8
|
|
9
9
|
describe '#filter_request' do
|
10
10
|
it 'should log request' do
|
11
|
-
|
12
|
-
"======= [FbGraph] API REQUEST STARTED
|
11
|
+
[
|
12
|
+
"======= [FbGraph] API REQUEST STARTED =======",
|
13
13
|
request.dump
|
14
|
-
|
14
|
+
].each do |output|
|
15
|
+
FbGraph.logger.should_receive(:info).with output
|
16
|
+
end
|
15
17
|
request_filter.filter_request(request)
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
21
|
describe '#filter_response' do
|
20
22
|
it 'should log response' do
|
21
|
-
|
22
|
-
"
|
23
|
-
response.dump
|
24
|
-
"
|
25
|
-
|
23
|
+
[
|
24
|
+
"--------------------------------------------------",
|
25
|
+
response.dump,
|
26
|
+
"======= [FbGraph] API REQUEST FINISHED ======="
|
27
|
+
].each do |output|
|
28
|
+
FbGraph.logger.should_receive(:info).with output
|
29
|
+
end
|
26
30
|
request_filter.filter_response(request, response)
|
27
31
|
end
|
28
32
|
end
|
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.6.
|
4
|
+
version: 2.6.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httpclient
|
@@ -522,7 +522,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
522
522
|
version: '0'
|
523
523
|
segments:
|
524
524
|
- 0
|
525
|
-
hash:
|
525
|
+
hash: 89501817370489109
|
526
526
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
527
527
|
none: false
|
528
528
|
requirements:
|
@@ -531,7 +531,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
531
531
|
version: '0'
|
532
532
|
segments:
|
533
533
|
- 0
|
534
|
-
hash:
|
534
|
+
hash: 89501817370489109
|
535
535
|
requirements: []
|
536
536
|
rubyforge_project:
|
537
537
|
rubygems_version: 1.8.24
|