fbrails 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fbrails.rb +10 -1
- data/lib/fbrails/graph.rb +1 -0
- data/lib/fbrails/version.rb +1 -1
- metadata +4 -4
data/lib/fbrails.rb
CHANGED
@@ -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
|
-
|
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)
|
data/lib/fbrails/graph.rb
CHANGED
data/lib/fbrails/version.rb
CHANGED
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.
|
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-
|
14
|
+
date: 2011-11-04 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: httpclient
|
18
|
-
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: *
|
26
|
+
version_requirements: *8379540
|
27
27
|
description: Small gem for auth & getting info from facebook
|
28
28
|
email:
|
29
29
|
- donotsendhere@gmail.com
|