rest-graph 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,9 @@
1
1
  = rest-graph changes history
2
2
 
3
+ == rest-graph 1.9.1 -- 2011-06-07
4
+
5
+ * [RestGraph] Fixed parse_fbs! where fbs contains some json. (thanks Bruce)
6
+
3
7
  == rest-graph 1.9.0 -- 2011-05-26
4
8
 
5
9
  * [RestGraph] Removed deprecated rest-graph/auto_load.rb, and
data/CONTRIBUTORS CHANGED
@@ -8,3 +8,4 @@ Florent Vaucelle (florent)
8
8
  Ethan Czahor (ethanz5)
9
9
  Nicolas Fouché (nfo)
10
10
  andy (coopsite)
11
+ Bruce Chu (bruchu)
data/Gemfile CHANGED
@@ -18,7 +18,6 @@ group :test do
18
18
  gem 'ruby-hmac'
19
19
 
20
20
  # for testing
21
- gem 'bones'
22
21
  gem 'rr'
23
22
  gem 'webmock'
24
23
  gem 'bacon'
@@ -350,7 +350,7 @@ class RestGraph < RestGraphStruct
350
350
  def parse_fbs! fbs
351
351
  self.data = check_sig_and_return_data(
352
352
  # take out facebook sometimes there but sometimes not quotes in cookies
353
- Rack::Utils.parse_query(fbs.to_s.gsub('"', '')))
353
+ Rack::Utils.parse_query(fbs.to_s.sub(/^"/, '').sub(/"$/, '')))
354
354
  end
355
355
 
356
356
  def parse_json! json
@@ -1,4 +1,4 @@
1
1
 
2
2
  require 'rest-graph/core'
3
3
 
4
- RestGraph::VERSION = '1.9.0'
4
+ RestGraph::VERSION = '1.9.1'
data/rest-graph.gemspec CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rest-graph}
5
- s.version = "1.9.0"
5
+ s.version = "1.9.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = [
9
9
  %q{Cardinal Blue},
10
10
  %q{Lin Jen-Shin (godfat)}]
11
- s.date = %q{2011-05-26}
11
+ s.date = %q{2011-06-07}
12
12
  s.description = %q{A lightweight Facebook Graph API client}
13
13
  s.email = [%q{dev (XD) cardinalblue.com}]
14
14
  s.extra_rdoc_files = [
@@ -108,7 +108,7 @@ Gem::Specification.new do |s|
108
108
  %q{--main},
109
109
  %q{README}]
110
110
  s.require_paths = [%q{lib}]
111
- s.rubygems_version = %q{1.8.4}
111
+ s.rubygems_version = %q{1.8.5}
112
112
  s.summary = %q{A lightweight Facebook Graph API client}
113
113
  s.test_files = [
114
114
  %q{test/test_api.rb},
data/test/test_parse.rb CHANGED
@@ -13,6 +13,15 @@ describe RestGraph do
13
13
  rg.data .should == {}
14
14
  end
15
15
 
16
+ should 'parse if fbs contains json as well' do
17
+ algorithm = 'HMAC-SHA256'
18
+ user = '{"country"=>"us", "age"=>{"min"=>21}}'
19
+ data = {'algorithm' => algorithm, 'user' => user}
20
+ rg = RestGraph.new(:data => data, :secret => 'secret')
21
+ sig = rg.send(:calculate_sig, data)
22
+ rg.parse_fbs!("\"#{rg.fbs}\"").should == data.merge('sig' => sig)
23
+ end
24
+
16
25
  should 'extract correct access_token or fail checking sig' do
17
26
  access_token = '1|2-5|f.'
18
27
  app_id = '1829'
@@ -14,7 +14,7 @@ describe RestGraph do
14
14
  should 'be serialized with lighten' do
15
15
  engines = if RUBY_VERSION >= '1.9.2'
16
16
  require 'psych'
17
- YAML::ENGINE.yamler = 'syck' # TODO: probably a bug?
17
+ YAML::ENGINE.yamler = 'psych'
18
18
  [Marshal, YAML, Psych]
19
19
  elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
20
20
  [Marshal]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-05-26 00:00:00.000000000Z
13
+ date: 2011-06-07 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
17
- requirement: &2153246120 !ruby/object:Gem::Requirement
17
+ requirement: &2153137640 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2153246120
25
+ version_requirements: *2153137640
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: em-http-request
28
- requirement: &2153245560 !ruby/object:Gem::Requirement
28
+ requirement: &2153136940 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2153245560
36
+ version_requirements: *2153136940
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rack
39
- requirement: &2153235280 !ruby/object:Gem::Requirement
39
+ requirement: &2153136260 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2153235280
47
+ version_requirements: *2153136260
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: yajl-ruby
50
- requirement: &2153234640 !ruby/object:Gem::Requirement
50
+ requirement: &2153135660 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2153234640
58
+ version_requirements: *2153135660
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: json
61
- requirement: &2153233980 !ruby/object:Gem::Requirement
61
+ requirement: &2153135040 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2153233980
69
+ version_requirements: *2153135040
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: json_pure
72
- requirement: &2153233340 !ruby/object:Gem::Requirement
72
+ requirement: &2153134480 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *2153233340
80
+ version_requirements: *2153134480
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: ruby-hmac
83
- requirement: &2153232560 !ruby/object:Gem::Requirement
83
+ requirement: &2153118560 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *2153232560
91
+ version_requirements: *2153118560
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: webmock
94
- requirement: &2153231940 !ruby/object:Gem::Requirement
94
+ requirement: &2153118020 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *2153231940
102
+ version_requirements: *2153118020
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: bacon
105
- requirement: &2153231260 !ruby/object:Gem::Requirement
105
+ requirement: &2153117440 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *2153231260
113
+ version_requirements: *2153117440
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: rr
116
- requirement: &2153230780 !ruby/object:Gem::Requirement
116
+ requirement: &2153116840 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,7 +121,7 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *2153230780
124
+ version_requirements: *2153116840
125
125
  description: A lightweight Facebook Graph API client
126
126
  email:
127
127
  - dev (XD) cardinalblue.com
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
241
  version: '0'
242
242
  requirements: []
243
243
  rubyforge_project:
244
- rubygems_version: 1.8.4
244
+ rubygems_version: 1.8.5
245
245
  signing_key:
246
246
  specification_version: 3
247
247
  summary: A lightweight Facebook Graph API client