fbrails 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,8 @@ require 'httpclient'
8
8
  module Fbrails
9
9
 
10
10
  class FailedToGet < StandardError
11
+ end
12
+ class TokenExpired < StandardError
11
13
  end
12
14
  def self.get (url,raw = false)
13
15
  # uri = URI.parse(url)
@@ -22,10 +24,17 @@ end
22
24
  end
23
25
  result = JSON.parse(resp)
24
26
  if result.has_key?("error")
25
- raise FailedToGet, "Failed to get, probably token expired"
27
+ #if result["error"].has_key?("type") && result["error"]["type"] == "OAuthException"
28
+ # raise TokenExpired, "Token expired"
29
+ # else
30
+ raise FailedToGet, "Failed to get"
31
+ # end
26
32
  else
27
33
  return result
28
34
  end
35
+
36
+ rescue HTTPClient::BadResponseError
37
+ raise TokenExpired, "Token expired"
29
38
  end
30
39
 
31
40
  def self.put(url)
@@ -1,6 +1,7 @@
1
1
  module Fbrails
2
2
  class Graph
3
3
 
4
+
4
5
  URL = "https://graph.facebook.com/"
5
6
 
6
7
  def initialize(token)
@@ -1,3 +1,3 @@
1
1
  module Fbrails
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-10-30 00:00:00.000000000Z
14
+ date: 2011-11-04 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httpclient
18
- requirement: &14632800 !ruby/object:Gem::Requirement
18
+ requirement: &8379540 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,7 +23,7 @@ dependencies:
23
23
  version: 2.2.2
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *14632800
26
+ version_requirements: *8379540
27
27
  description: Small gem for auth & getting info from facebook
28
28
  email:
29
29
  - donotsendhere@gmail.com