fgraph 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/History CHANGED
@@ -1,3 +1,9 @@
1
+ v0.3.5
2
+ * Replace fbs_cookies.gsub! with .gsub
3
+ * FGraph.get_id now supports :id
4
+ * Replace array.count with array.length
5
+ * Fix client_test failures
6
+
1
7
  v0.3.4
2
8
  * Add FGraph::Client#update_options method
3
9
 
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 4
2
+ :patch: 0
3
3
  :major: 0
4
4
  :build:
5
- :minor: 3
5
+ :minor: 4
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.count == 1 and args.first.is_a?(Array)
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]
@@ -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.count.should == fb_response['data'].count
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.count.should == response['data'].count
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: 27
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
8
  - 4
10
- version: 0.3.4
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-09 00:00:00 +08:00
18
+ date: 2010-09-12 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency