fb_graph 2.7.8 → 2.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/fb_graph.rb +3 -2
- data/lib/fb_graph/auth/cookie.rb +0 -2
- data/lib/fb_graph/connections/tabs.rb +8 -0
- data/lib/fb_graph/request_filters.rb +3 -0
- data/lib/fb_graph/{debugger.rb → request_filters/debugger.rb} +2 -7
- data/lib/fb_graph/request_filters/scrubber.rb +13 -0
- data/spec/fb_graph/{debugger_spec.rb → request_filters/debugger_spec.rb} +2 -2
- data/spec/fb_graph/request_filters/scrubber_spec.rb +23 -0
- metadata +35 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca4353ef5651ff8844ef15ccae453ee6cacb1ac4
|
4
|
+
data.tar.gz: 619eda1182b17332e4b42041131880decfa3f4c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6588926778a871a9a735a8ce994dea02fd9ef2bb72de9514da29b0c509102b77821be6194a7898ae1f1bbd9ceac0a7332bae921fb0cde7810fbcd50d572b4fee
|
7
|
+
data.tar.gz: ba8b760a2cc8adc3fa9e7fa76ad45e3ce0ffce710821ff606699948d70fb17148b5fd309051de222a1fbfbbaaad97e6eb1e40b3e29536bb69adfd9537d378115
|
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.9
|
data/lib/fb_graph.rb
CHANGED
@@ -46,7 +46,8 @@ module FbGraph
|
|
46
46
|
_http_client_ = HTTPClient.new(
|
47
47
|
:agent_name => "FbGraph (#{VERSION})"
|
48
48
|
)
|
49
|
-
_http_client_.request_filter <<
|
49
|
+
_http_client_.request_filter << RequestFilters::Scrubber.new
|
50
|
+
_http_client_.request_filter << RequestFilters::Debugger.new if debugging?
|
50
51
|
http_config.try(:call, _http_client_)
|
51
52
|
_http_client_
|
52
53
|
end
|
@@ -57,7 +58,7 @@ module FbGraph
|
|
57
58
|
end
|
58
59
|
|
59
60
|
require 'fb_graph/exception'
|
60
|
-
require 'fb_graph/
|
61
|
+
require 'fb_graph/request_filters'
|
61
62
|
|
62
63
|
require 'fb_graph/auth'
|
63
64
|
require 'fb_graph/comparison'
|
data/lib/fb_graph/auth/cookie.rb
CHANGED
@@ -18,6 +18,14 @@ module FbGraph
|
|
18
18
|
tab = self.connection :tabs, options.merge(:connection_scope => application.identifier)
|
19
19
|
tab.present?
|
20
20
|
end
|
21
|
+
|
22
|
+
def tab_for_app(application, options = {})
|
23
|
+
response = get options.merge(:connection => :tabs, :connection_scope => application.identifier)
|
24
|
+
tab = response[:data].first
|
25
|
+
Tab.new tab[:id], tab.merge(
|
26
|
+
:access_token => options[:access_token] || self.access_token
|
27
|
+
)
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -1,16 +1,11 @@
|
|
1
1
|
module FbGraph
|
2
|
-
module
|
3
|
-
class
|
4
|
-
# Callback called in HTTPClient (before sending a request)
|
5
|
-
# request:: HTTP::Message
|
2
|
+
module RequestFilters
|
3
|
+
class Debugger
|
6
4
|
def filter_request(request)
|
7
5
|
started = "======= [FbGraph] API REQUEST STARTED ======="
|
8
6
|
log started, request.dump
|
9
7
|
end
|
10
8
|
|
11
|
-
# Callback called in HTTPClient (after received a response)
|
12
|
-
# request:: HTTP::Message
|
13
|
-
# response:: HTTP::Message
|
14
9
|
def filter_response(request, response)
|
15
10
|
finished = "======= [FbGraph] API REQUEST FINISHED ======="
|
16
11
|
log '-' * 50, response.dump, finished
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe FbGraph::Debugger
|
3
|
+
describe FbGraph::RequestFilters::Debugger do
|
4
4
|
let(:resource_endpoint) { 'https://graph.facebook.com/matake' }
|
5
5
|
let(:request) { HTTP::Message.new_request(:get, URI.parse(resource_endpoint)) }
|
6
6
|
let(:response) { HTTP::Message.new_response({:hello => 'world'}.to_json) }
|
7
|
-
let(:request_filter) { FbGraph::Debugger
|
7
|
+
let(:request_filter) { FbGraph::RequestFilters::Debugger.new }
|
8
8
|
|
9
9
|
describe '#filter_request' do
|
10
10
|
it 'should log request' do
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe FbGraph::RequestFilters::Scrubber do
|
4
|
+
describe '#filter_response' do
|
5
|
+
let(:original_body) { "{ \"name\": \"John\x80\" }".force_encoding('UTF-8') }
|
6
|
+
let(:resource_endpoint) { 'https://graph.facebook.com/matake' }
|
7
|
+
let(:request) { HTTP::Message.new_request(:get, URI.parse(resource_endpoint)) }
|
8
|
+
let(:response) { HTTP::Message.new_response(original_body) }
|
9
|
+
let(:request_filter) { FbGraph::RequestFilters::Scrubber.new }
|
10
|
+
|
11
|
+
if 'string'.respond_to?(:scrub!)
|
12
|
+
it 'should scrub response body' do
|
13
|
+
request_filter.filter_response(request, response)
|
14
|
+
response.body.should eq "{ \"name\": \"John\uFFFD\" }"
|
15
|
+
end
|
16
|
+
else
|
17
|
+
it 'should not do anything' do
|
18
|
+
request_filter.filter_response(request, response)
|
19
|
+
response.body.should eq original_body
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,139 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nov matake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.2.0.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.2.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack-oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.14.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.14.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tzinfo
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: multi_json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.3'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.8'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.8'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: cover_me
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.2.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.2.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '2'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '2'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: fb_graph-mock
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 1.0.1
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.0.1
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: actionpack
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 3.0.6
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 3.0.6
|
139
139
|
description: A full-stack Facebook Graph API wrapper in Ruby.
|
@@ -144,10 +144,10 @@ extra_rdoc_files:
|
|
144
144
|
- LICENSE
|
145
145
|
- README.rdoc
|
146
146
|
files:
|
147
|
-
- .document
|
148
|
-
- .gitignore
|
149
|
-
- .rspec
|
150
|
-
- .travis.yml
|
147
|
+
- ".document"
|
148
|
+
- ".gitignore"
|
149
|
+
- ".rspec"
|
150
|
+
- ".travis.yml"
|
151
151
|
- Gemfile
|
152
152
|
- LICENSE
|
153
153
|
- README.rdoc
|
@@ -269,7 +269,6 @@ files:
|
|
269
269
|
- lib/fb_graph/connections/videos.rb
|
270
270
|
- lib/fb_graph/connections/votes.rb
|
271
271
|
- lib/fb_graph/cover.rb
|
272
|
-
- lib/fb_graph/debugger.rb
|
273
272
|
- lib/fb_graph/device.rb
|
274
273
|
- lib/fb_graph/doc.rb
|
275
274
|
- lib/fb_graph/domain.rb
|
@@ -311,6 +310,9 @@ files:
|
|
311
310
|
- lib/fb_graph/question.rb
|
312
311
|
- lib/fb_graph/question_option.rb
|
313
312
|
- lib/fb_graph/reach_estimate.rb
|
313
|
+
- lib/fb_graph/request_filters.rb
|
314
|
+
- lib/fb_graph/request_filters/debugger.rb
|
315
|
+
- lib/fb_graph/request_filters/scrubber.rb
|
314
316
|
- lib/fb_graph/review.rb
|
315
317
|
- lib/fb_graph/role.rb
|
316
318
|
- lib/fb_graph/score.rb
|
@@ -438,7 +440,6 @@ files:
|
|
438
440
|
- spec/fb_graph/connections/user_likes_spec.rb
|
439
441
|
- spec/fb_graph/connections/videos_spec.rb
|
440
442
|
- spec/fb_graph/connections/votes_spec.rb
|
441
|
-
- spec/fb_graph/debugger_spec.rb
|
442
443
|
- spec/fb_graph/doc_spec.rb
|
443
444
|
- spec/fb_graph/domain_spec.rb
|
444
445
|
- spec/fb_graph/education_spec.rb
|
@@ -476,6 +477,8 @@ files:
|
|
476
477
|
- spec/fb_graph/query_spec.rb
|
477
478
|
- spec/fb_graph/question_spec.rb
|
478
479
|
- spec/fb_graph/reach_estimate_spec.rb
|
480
|
+
- spec/fb_graph/request_filters/debugger_spec.rb
|
481
|
+
- spec/fb_graph/request_filters/scrubber_spec.rb
|
479
482
|
- spec/fb_graph/review_spec.rb
|
480
483
|
- spec/fb_graph/searchable_spec.rb
|
481
484
|
- spec/fb_graph/seriarization_spec.rb
|
@@ -498,22 +501,22 @@ licenses: []
|
|
498
501
|
metadata: {}
|
499
502
|
post_install_message:
|
500
503
|
rdoc_options:
|
501
|
-
- --charset=UTF-8
|
504
|
+
- "--charset=UTF-8"
|
502
505
|
require_paths:
|
503
506
|
- lib
|
504
507
|
required_ruby_version: !ruby/object:Gem::Requirement
|
505
508
|
requirements:
|
506
|
-
- -
|
509
|
+
- - ">="
|
507
510
|
- !ruby/object:Gem::Version
|
508
511
|
version: '0'
|
509
512
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
510
513
|
requirements:
|
511
|
-
- -
|
514
|
+
- - ">="
|
512
515
|
- !ruby/object:Gem::Version
|
513
516
|
version: '0'
|
514
517
|
requirements: []
|
515
518
|
rubyforge_project:
|
516
|
-
rubygems_version: 2.0
|
519
|
+
rubygems_version: 2.2.0
|
517
520
|
signing_key:
|
518
521
|
specification_version: 4
|
519
522
|
summary: A full-stack Facebook Graph API wrapper in Ruby.
|
@@ -621,7 +624,6 @@ test_files:
|
|
621
624
|
- spec/fb_graph/connections/user_likes_spec.rb
|
622
625
|
- spec/fb_graph/connections/videos_spec.rb
|
623
626
|
- spec/fb_graph/connections/votes_spec.rb
|
624
|
-
- spec/fb_graph/debugger_spec.rb
|
625
627
|
- spec/fb_graph/doc_spec.rb
|
626
628
|
- spec/fb_graph/domain_spec.rb
|
627
629
|
- spec/fb_graph/education_spec.rb
|
@@ -659,6 +661,8 @@ test_files:
|
|
659
661
|
- spec/fb_graph/query_spec.rb
|
660
662
|
- spec/fb_graph/question_spec.rb
|
661
663
|
- spec/fb_graph/reach_estimate_spec.rb
|
664
|
+
- spec/fb_graph/request_filters/debugger_spec.rb
|
665
|
+
- spec/fb_graph/request_filters/scrubber_spec.rb
|
662
666
|
- spec/fb_graph/review_spec.rb
|
663
667
|
- spec/fb_graph/searchable_spec.rb
|
664
668
|
- spec/fb_graph/seriarization_spec.rb
|