fgraph 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History +6 -0
- data/VERSION.yml +2 -2
- data/lib/fgraph.rb +2 -2
- data/lib/fgraph/rails/fgraph_helper.rb +1 -1
- data/test/fgraph/client_test.rb +2 -2
- data/test/fgraph_test.rb +2 -2
- metadata +4 -4
data/History
CHANGED
data/VERSION.yml
CHANGED
data/lib/fgraph.rb
CHANGED
@@ -114,7 +114,7 @@ module FGraph
|
|
114
114
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
115
115
|
|
116
116
|
# If first input before option is an array
|
117
|
-
if args.
|
117
|
+
if args.length == 1 and args.first.is_a?(Array)
|
118
118
|
args = args.first.map do |arg|
|
119
119
|
self.get_id(arg)
|
120
120
|
end
|
@@ -391,7 +391,7 @@ module FGraph
|
|
391
391
|
#
|
392
392
|
def get_id(id)
|
393
393
|
return unless id
|
394
|
-
id = id['id'] if id.is_a?(Hash)
|
394
|
+
id = id['id'] || id[:id] if id.is_a?(Hash)
|
395
395
|
id
|
396
396
|
end
|
397
397
|
end
|
@@ -29,7 +29,7 @@ module FGraph
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# Parse facebook cookies
|
32
|
-
fbs_cookies = CGI.parse(fbs_cookies.gsub
|
32
|
+
fbs_cookies = CGI.parse(fbs_cookies.gsub(/(^\"|\"$)/, ''))
|
33
33
|
session_cookies = {}
|
34
34
|
fbs_cookies.each do |key, value|
|
35
35
|
session_cookies[key] = value[0]
|
data/test/fgraph/client_test.rb
CHANGED
@@ -136,7 +136,7 @@ class ClientTest < Test::Unit::TestCase
|
|
136
136
|
context "FGraph::Client#insights" do
|
137
137
|
should "auto populate :client_id and :oauth_app_access_token" do
|
138
138
|
client = fb_client
|
139
|
-
client.options[:app_access_token] = FACEBOOK_OAUTH_APP_ACCESS_TOKEN
|
139
|
+
client.options[:app_access_token] = { 'access_token' => FACEBOOK_OAUTH_APP_ACCESS_TOKEN }
|
140
140
|
|
141
141
|
FGraph.expects(:insights).with(FACEBOOK_APP_ID, FACEBOOK_OAUTH_APP_ACCESS_TOKEN, {})
|
142
142
|
client.insights
|
@@ -144,7 +144,7 @@ class ClientTest < Test::Unit::TestCase
|
|
144
144
|
|
145
145
|
should "auto retrieve :oauth_app_access_token option" do
|
146
146
|
client = fb_client
|
147
|
-
client.expects(:oauth_app_access_token).returns(FACEBOOK_OAUTH_APP_ACCESS_TOKEN)
|
147
|
+
client.expects(:oauth_app_access_token).returns({ 'access_token' => FACEBOOK_OAUTH_APP_ACCESS_TOKEN })
|
148
148
|
FGraph.expects(:insights).with(FACEBOOK_APP_ID, FACEBOOK_OAUTH_APP_ACCESS_TOKEN, {
|
149
149
|
:metric_path => 'application_api_calls/day'
|
150
150
|
})
|
data/test/fgraph_test.rb
CHANGED
@@ -253,7 +253,7 @@ class FGraphTest < Test::Unit::TestCase
|
|
253
253
|
|
254
254
|
collection = FGraph.handle_response(fb_response)
|
255
255
|
collection.class.should == FGraph::Collection
|
256
|
-
collection.
|
256
|
+
collection.length.should == fb_response['data'].length
|
257
257
|
end
|
258
258
|
|
259
259
|
should "raise QueryParseError" do
|
@@ -295,7 +295,7 @@ class FGraphTest < Test::Unit::TestCase
|
|
295
295
|
}
|
296
296
|
|
297
297
|
collection = FGraph::Collection.new(response)
|
298
|
-
collection.
|
298
|
+
collection.length.should == response['data'].length
|
299
299
|
collection.first.should == response['data'].first
|
300
300
|
collection.next_url.should == response['paging']['next']
|
301
301
|
collection.previous_url.should == response['paging']['previous']
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fgraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 3
|
9
8
|
- 4
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Herryanto Siatono
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-12 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|