facebooker 1.0.31 → 1.0.41
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +7 -0
- data/Manifest.txt +5 -0
- data/README.rdoc +9 -0
- data/facebooker.gemspec +8 -9
- data/generators/facebook/templates/public/javascripts/facebooker.js +10 -16
- data/init.rb +4 -1
- data/install.rb +1 -1
- data/lib/facebooker.rb +75 -20
- data/lib/facebooker/adapters/bebo_adapter.rb +9 -9
- data/lib/facebooker/data.rb +14 -14
- data/lib/facebooker/models/page.rb +16 -0
- data/lib/facebooker/models/photo.rb +7 -0
- data/lib/facebooker/models/user.rb +75 -28
- data/lib/facebooker/parser.rb +187 -127
- data/lib/facebooker/rails/backwards_compatible_param_checks.rb +31 -0
- data/lib/facebooker/rails/controller.rb +30 -7
- data/lib/facebooker/rails/extensions/rack_setup.rb +5 -1
- data/lib/facebooker/rails/facebook_request_fix.rb +5 -5
- data/lib/facebooker/rails/facebook_request_fix_2-3.rb +31 -0
- data/lib/facebooker/rails/facebook_url_rewriting.rb +7 -2
- data/lib/facebooker/rails/helpers.rb +29 -5
- data/lib/facebooker/rails/helpers/fb_connect.rb +14 -5
- data/lib/facebooker/rails/publisher.rb +26 -12
- data/lib/facebooker/service.rb +64 -56
- data/lib/facebooker/session.rb +56 -22
- data/lib/facebooker/version.rb +1 -1
- data/lib/rack/facebook.rb +26 -14
- data/lib/tasks/tunnel.rake +1 -1
- data/test/facebooker/adapters_test.rb +78 -0
- data/test/facebooker/data_test.rb +14 -14
- data/test/facebooker/models/page_test.rb +46 -0
- data/test/facebooker/models/photo_test.rb +16 -0
- data/test/facebooker/models/user_test.rb +83 -48
- data/test/facebooker/rails/facebook_request_fix_2-3_test.rb +25 -0
- data/test/facebooker/rails/facebook_url_rewriting_test.rb +39 -0
- data/test/facebooker/rails/publisher_test.rb +5 -1
- data/test/facebooker/rails_integration_test.rb +52 -8
- data/test/facebooker/service_test.rb +58 -0
- data/test/facebooker/session_test.rb +106 -92
- data/test/facebooker_test.rb +2 -2
- data/test/rack/facebook_test.rb +4 -4
- data/test/test_helper.rb +10 -3
- metadata +14 -4
data/test/facebooker_test.rb
CHANGED
@@ -232,7 +232,7 @@ class TestFacebooker < Test::Unit::TestCase
|
|
232
232
|
photos = @session.get_photos([97503428461115590, 97503428461115573])
|
233
233
|
assert_equal 2, photos.size
|
234
234
|
assert_equal "Rooftop barbecues make me act funny", photos.first.caption
|
235
|
-
assert_equal 97503428461115590, photos[0].id
|
235
|
+
assert_equal "97503428461115590", photos[0].id
|
236
236
|
end
|
237
237
|
|
238
238
|
def test_can_get_photos_by_subject_and_album
|
@@ -485,7 +485,7 @@ class TestFacebooker < Test::Unit::TestCase
|
|
485
485
|
def example_notifications_send_xml
|
486
486
|
<<-XML
|
487
487
|
<?xml version="1.0" encoding="UTF-8"?>
|
488
|
-
<notifications_send_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">http://www.facebook.com/send_email.php?from=211031&id=52</notifications_send_response>
|
488
|
+
<notifications_send_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">http://www.facebook.com/send_email.php?from=211031&id=52</notifications_send_response>
|
489
489
|
XML
|
490
490
|
end
|
491
491
|
|
data/test/rack/facebook_test.rb
CHANGED
@@ -6,12 +6,12 @@ require 'rack/mock'
|
|
6
6
|
class Rack::FacebookTest < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def setup
|
9
|
-
|
9
|
+
flexmock(Facebooker).should_receive(:secret_key).and_return('secret')
|
10
10
|
@app = lambda do |env|
|
11
11
|
@env = env
|
12
12
|
Rack::Response.new().to_a
|
13
13
|
end
|
14
|
-
@facebook = Rack::Facebook.new(@app
|
14
|
+
@facebook = Rack::Facebook.new(@app)
|
15
15
|
end
|
16
16
|
|
17
17
|
def params(p)
|
@@ -47,13 +47,13 @@ class Rack::FacebookTest < Test::Unit::TestCase
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def test_skips_with_false_condition
|
50
|
-
@facebook = Rack::Facebook.new(@app
|
50
|
+
@facebook = Rack::Facebook.new(@app) { false }
|
51
51
|
response = app.post("/", :input => params(:fb_sig_user => 'ignored'))
|
52
52
|
assert_equal 200, response.status
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_verifies_with_true_condition
|
56
|
-
@facebook = Rack::Facebook.new(@app
|
56
|
+
@facebook = Rack::Facebook.new(@app) { true }
|
57
57
|
response = app.post("/", :input => params(:fb_sig_user => 'ignored'))
|
58
58
|
assert_equal 400, response.status
|
59
59
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'rubygems'
|
3
3
|
|
4
|
+
begin
|
5
|
+
require 'nokogiri'
|
6
|
+
rescue LoadError
|
7
|
+
# Should work without nokogiri
|
8
|
+
end
|
9
|
+
|
4
10
|
begin
|
5
11
|
require 'multi_rails_init'
|
6
12
|
rescue LoadError
|
7
13
|
# multi rails not installed, test against newest supported version of Rails
|
8
14
|
gem 'rails', '2.2.2'
|
9
15
|
end
|
16
|
+
require 'activesupport'
|
10
17
|
require 'flexmock/test_unit'
|
11
18
|
require 'mocha'
|
12
19
|
|
@@ -38,10 +45,10 @@ class Test::Unit::TestCase
|
|
38
45
|
def establish_session(session = @session)
|
39
46
|
mock = flexmock(Net::HTTP).should_receive(:post_form).and_return(example_auth_token_xml).once.ordered(:posts)
|
40
47
|
mock.should_receive(:post_form).and_return(example_get_session_xml).once.ordered(:posts)
|
41
|
-
session.secure!
|
48
|
+
session.secure!
|
42
49
|
mock
|
43
50
|
end
|
44
|
-
|
51
|
+
|
45
52
|
def example_auth_token_xml
|
46
53
|
<<-XML
|
47
54
|
<?xml version="1.0" encoding="UTF-8"?>
|
@@ -52,7 +59,7 @@ class Test::Unit::TestCase
|
|
52
59
|
</auth_createToken_response>
|
53
60
|
XML
|
54
61
|
end
|
55
|
-
|
62
|
+
|
56
63
|
def example_get_session_xml
|
57
64
|
<<-XML
|
58
65
|
<?xml version="1.0" encoding="UTF-8"?>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facebooker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Fowler
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2009-
|
16
|
+
date: 2009-07-15 00:00:00 -04:00
|
17
17
|
default_executable:
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ">="
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 2.3.2
|
38
38
|
version:
|
39
39
|
description: |-
|
40
40
|
Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://wiki.developers.facebook.com/index.php/API]. Its goals are:
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- lib/facebooker/models/video.rb
|
133
133
|
- lib/facebooker/models/work_info.rb
|
134
134
|
- lib/facebooker/parser.rb
|
135
|
+
- lib/facebooker/rails/backwards_compatible_param_checks.rb
|
135
136
|
- lib/facebooker/rails/controller.rb
|
136
137
|
- lib/facebooker/rails/cucumber.rb
|
137
138
|
- lib/facebooker/rails/cucumber/world.rb
|
@@ -141,6 +142,7 @@ files:
|
|
141
142
|
- lib/facebooker/rails/facebook_form_builder.rb
|
142
143
|
- lib/facebooker/rails/facebook_pretty_errors.rb
|
143
144
|
- lib/facebooker/rails/facebook_request_fix.rb
|
145
|
+
- lib/facebooker/rails/facebook_request_fix_2-3.rb
|
144
146
|
- lib/facebooker/rails/facebook_session_handling.rb
|
145
147
|
- lib/facebooker/rails/facebook_url_helper.rb
|
146
148
|
- lib/facebooker/rails/facebook_url_rewriting.rb
|
@@ -171,9 +173,12 @@ files:
|
|
171
173
|
- test/facebooker/mobile_test.rb
|
172
174
|
- test/facebooker/model_test.rb
|
173
175
|
- test/facebooker/models/event_test.rb
|
176
|
+
- test/facebooker/models/page_test.rb
|
177
|
+
- test/facebooker/models/photo_test.rb
|
174
178
|
- test/facebooker/models/user_test.rb
|
175
179
|
- test/facebooker/rails/publisher_test.rb
|
176
180
|
- test/facebooker/rails_integration_test.rb
|
181
|
+
- test/facebooker/rails/facebook_request_fix_2-3_test.rb
|
177
182
|
- test/facebooker/server_cache_test.rb
|
178
183
|
- test/facebooker/session_test.rb
|
179
184
|
- test/facebooker_test.rb
|
@@ -209,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
214
|
requirements: []
|
210
215
|
|
211
216
|
rubyforge_project: facebooker
|
212
|
-
rubygems_version: 1.3.
|
217
|
+
rubygems_version: 1.3.4
|
213
218
|
signing_key:
|
214
219
|
specification_version: 3
|
215
220
|
summary: Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://wiki.developers.facebook.com/index.php/API]
|
@@ -222,10 +227,15 @@ test_files:
|
|
222
227
|
- test/facebooker/mobile_test.rb
|
223
228
|
- test/facebooker/model_test.rb
|
224
229
|
- test/facebooker/models/event_test.rb
|
230
|
+
- test/facebooker/models/page_test.rb
|
231
|
+
- test/facebooker/models/photo_test.rb
|
225
232
|
- test/facebooker/models/user_test.rb
|
233
|
+
- test/facebooker/rails/facebook_request_fix_2-3_test.rb
|
234
|
+
- test/facebooker/rails/facebook_url_rewriting_test.rb
|
226
235
|
- test/facebooker/rails/publisher_test.rb
|
227
236
|
- test/facebooker/rails_integration_test.rb
|
228
237
|
- test/facebooker/server_cache_test.rb
|
238
|
+
- test/facebooker/service_test.rb
|
229
239
|
- test/facebooker/session_test.rb
|
230
240
|
- test/facebooker_test.rb
|
231
241
|
- test/net/http_multipart_post_test.rb
|