al-facebooker 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +0 -0
- data/COPYING +19 -0
- data/History.txt +17 -0
- data/Manifest.txt +114 -0
- data/README +46 -0
- data/README.txt +97 -0
- data/Rakefile +76 -0
- data/TODO.txt +10 -0
- data/generators/facebook/facebook_generator.rb +14 -0
- data/generators/facebook/templates/config/facebooker.yml +46 -0
- data/generators/facebook/templates/public/javascripts/facebooker.js +106 -0
- data/generators/facebook_controller/USAGE +33 -0
- data/generators/facebook_controller/facebook_controller_generator.rb +40 -0
- data/generators/facebook_controller/templates/controller.rb +7 -0
- data/generators/facebook_controller/templates/functional_test.rb +11 -0
- data/generators/facebook_controller/templates/helper.rb +2 -0
- data/generators/facebook_controller/templates/view.fbml.erb +2 -0
- data/generators/facebook_controller/templates/view.html.erb +2 -0
- data/generators/facebook_publisher/facebook_publisher_generator.rb +14 -0
- data/generators/facebook_publisher/templates/create_facebook_templates.rb +15 -0
- data/generators/facebook_publisher/templates/publisher.rb +3 -0
- data/generators/facebook_scaffold/USAGE +27 -0
- data/generators/facebook_scaffold/facebook_scaffold_generator.rb +118 -0
- data/generators/facebook_scaffold/templates/controller.rb +93 -0
- data/generators/facebook_scaffold/templates/facebook_style.css +2579 -0
- data/generators/facebook_scaffold/templates/functional_test.rb +89 -0
- data/generators/facebook_scaffold/templates/helper.rb +2 -0
- data/generators/facebook_scaffold/templates/layout.fbml.erb +6 -0
- data/generators/facebook_scaffold/templates/layout.html.erb +17 -0
- data/generators/facebook_scaffold/templates/style.css +74 -0
- data/generators/facebook_scaffold/templates/view_edit.fbml.erb +13 -0
- data/generators/facebook_scaffold/templates/view_edit.html.erb +18 -0
- data/generators/facebook_scaffold/templates/view_index.fbml.erb +24 -0
- data/generators/facebook_scaffold/templates/view_index.html.erb +24 -0
- data/generators/facebook_scaffold/templates/view_new.fbml.erb +12 -0
- data/generators/facebook_scaffold/templates/view_new.html.erb +17 -0
- data/generators/facebook_scaffold/templates/view_show.fbml.erb +10 -0
- data/generators/facebook_scaffold/templates/view_show.html.erb +10 -0
- data/generators/publisher/publisher_generator.rb +14 -0
- data/generators/xd_receiver/templates/xd_receiver.html +10 -0
- data/generators/xd_receiver/xd_receiver_generator.rb +9 -0
- data/init.rb +70 -0
- data/install.rb +12 -0
- data/lib/facebooker.rb +171 -0
- data/lib/facebooker/adapters/adapter_base.rb +87 -0
- data/lib/facebooker/adapters/bebo_adapter.rb +75 -0
- data/lib/facebooker/adapters/facebook_adapter.rb +48 -0
- data/lib/facebooker/admin.rb +28 -0
- data/lib/facebooker/batch_request.rb +44 -0
- data/lib/facebooker/data.rb +57 -0
- data/lib/facebooker/feed.rb +78 -0
- data/lib/facebooker/logging.rb +51 -0
- data/lib/facebooker/model.rb +123 -0
- data/lib/facebooker/models/affiliation.rb +10 -0
- data/lib/facebooker/models/album.rb +11 -0
- data/lib/facebooker/models/applicationproperties.rb +39 -0
- data/lib/facebooker/models/cookie.rb +10 -0
- data/lib/facebooker/models/education_info.rb +11 -0
- data/lib/facebooker/models/event.rb +26 -0
- data/lib/facebooker/models/friend_list.rb +14 -0
- data/lib/facebooker/models/group.rb +35 -0
- data/lib/facebooker/models/info_item.rb +10 -0
- data/lib/facebooker/models/info_section.rb +10 -0
- data/lib/facebooker/models/location.rb +8 -0
- data/lib/facebooker/models/notifications.rb +17 -0
- data/lib/facebooker/models/page.rb +27 -0
- data/lib/facebooker/models/photo.rb +10 -0
- data/lib/facebooker/models/tag.rb +12 -0
- data/lib/facebooker/models/user.rb +396 -0
- data/lib/facebooker/models/work_info.rb +9 -0
- data/lib/facebooker/parser.rb +547 -0
- data/lib/facebooker/rails/controller.rb +280 -0
- data/lib/facebooker/rails/facebook_asset_path.rb +18 -0
- data/lib/facebooker/rails/facebook_form_builder.rb +112 -0
- data/lib/facebooker/rails/facebook_pretty_errors.rb +14 -0
- data/lib/facebooker/rails/facebook_request_fix.rb +24 -0
- data/lib/facebooker/rails/facebook_session_handling.rb +69 -0
- data/lib/facebooker/rails/facebook_url_helper.rb +191 -0
- data/lib/facebooker/rails/facebook_url_rewriting.rb +39 -0
- data/lib/facebooker/rails/helpers.rb +681 -0
- data/lib/facebooker/rails/helpers/fb_connect.rb +34 -0
- data/lib/facebooker/rails/profile_publisher_extensions.rb +42 -0
- data/lib/facebooker/rails/publisher.rb +510 -0
- data/lib/facebooker/rails/routing.rb +49 -0
- data/lib/facebooker/rails/test_helpers.rb +88 -0
- data/lib/facebooker/rails/utilities.rb +22 -0
- data/lib/facebooker/server_cache.rb +24 -0
- data/lib/facebooker/service.rb +92 -0
- data/lib/facebooker/session.rb +566 -0
- data/lib/facebooker/version.rb +9 -0
- data/lib/net/http_multipart_post.rb +123 -0
- data/lib/tasks/facebooker.rake +18 -0
- data/lib/tasks/tunnel.rake +46 -0
- data/rails/init.rb +1 -0
- data/setup.rb +1585 -0
- data/templates/layout.erb +24 -0
- data/test/adapters_test.rb +98 -0
- data/test/batch_request_test.rb +82 -0
- data/test/event_test.rb +15 -0
- data/test/facebook_admin_test.rb +76 -0
- data/test/facebook_cache_test.rb +44 -0
- data/test/facebook_data_test.rb +86 -0
- data/test/facebooker_test.rb +855 -0
- data/test/fixtures/multipart_post_body_with_only_parameters.txt +33 -0
- data/test/fixtures/multipart_post_body_with_single_file.txt +38 -0
- data/test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt +38 -0
- data/test/http_multipart_post_test.rb +54 -0
- data/test/logging_test.rb +43 -0
- data/test/model_test.rb +91 -0
- data/test/publisher_test.rb +458 -0
- data/test/rails_integration_test.rb +1224 -0
- data/test/session_test.rb +613 -0
- data/test/test_helper.rb +60 -0
- data/test/user_test.rb +270 -0
- metadata +185 -0
data/CHANGELOG.txt
ADDED
File without changes
|
data/COPYING
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2007 Chad Fowler <chad@infoether.com>
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in the
|
6
|
+
# Software without restriction, including without limitation the rights to use,
|
7
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
8
|
+
# Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
18
|
+
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
19
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/History.txt
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
=== x.x.x / 2009-xx-xx
|
2
|
+
|
3
|
+
* Modified fql_query to return results as Hashes as a last resort [Alan Larkin]
|
4
|
+
* fixed typo in set app properties parser [Andrew Grim, shane]
|
5
|
+
* Removed actor_id param from templatized feed [shane]
|
6
|
+
* Added admin.get_allocation [shane]
|
7
|
+
* Added data.get_cookies and data.set_cookie [shane]
|
8
|
+
* Added admin.get_app_properties and admin.set_app_properties [shane]
|
9
|
+
|
10
|
+
=== 0.9.9 / 2008-09-08
|
11
|
+
|
12
|
+
* Re-package as gem after reworking for new API
|
13
|
+
|
14
|
+
|
15
|
+
=== 0.9.5 / 2008-02-13
|
16
|
+
|
17
|
+
* Next release of documentation
|
data/Manifest.txt
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
CHANGELOG.txt
|
2
|
+
COPYING
|
3
|
+
History.txt
|
4
|
+
Manifest.txt
|
5
|
+
README
|
6
|
+
README.txt
|
7
|
+
Rakefile
|
8
|
+
TODO.txt
|
9
|
+
generators/publisher/publisher_generator.rb
|
10
|
+
generators/facebook/facebook_generator.rb
|
11
|
+
generators/facebook/templates/config/facebooker.yml
|
12
|
+
generators/facebook/templates/public/javascripts/facebooker.js
|
13
|
+
generators/facebook_controller/USAGE
|
14
|
+
generators/facebook_controller/facebook_controller_generator.rb
|
15
|
+
generators/facebook_controller/templates/controller.rb
|
16
|
+
generators/facebook_controller/templates/functional_test.rb
|
17
|
+
generators/facebook_controller/templates/helper.rb
|
18
|
+
generators/facebook_controller/templates/view.fbml.erb
|
19
|
+
generators/facebook_controller/templates/view.html.erb
|
20
|
+
generators/facebook_publisher/facebook_publisher_generator.rb
|
21
|
+
generators/facebook_publisher/templates/create_facebook_templates.rb
|
22
|
+
generators/facebook_publisher/templates/publisher.rb
|
23
|
+
generators/facebook_scaffold/USAGE
|
24
|
+
generators/facebook_scaffold/facebook_scaffold_generator.rb
|
25
|
+
generators/facebook_scaffold/templates/controller.rb
|
26
|
+
generators/facebook_scaffold/templates/facebook_style.css
|
27
|
+
generators/facebook_scaffold/templates/functional_test.rb
|
28
|
+
generators/facebook_scaffold/templates/helper.rb
|
29
|
+
generators/facebook_scaffold/templates/layout.fbml.erb
|
30
|
+
generators/facebook_scaffold/templates/layout.html.erb
|
31
|
+
generators/facebook_scaffold/templates/style.css
|
32
|
+
generators/facebook_scaffold/templates/view_edit.fbml.erb
|
33
|
+
generators/facebook_scaffold/templates/view_edit.html.erb
|
34
|
+
generators/facebook_scaffold/templates/view_index.fbml.erb
|
35
|
+
generators/facebook_scaffold/templates/view_index.html.erb
|
36
|
+
generators/facebook_scaffold/templates/view_new.fbml.erb
|
37
|
+
generators/facebook_scaffold/templates/view_new.html.erb
|
38
|
+
generators/facebook_scaffold/templates/view_show.fbml.erb
|
39
|
+
generators/facebook_scaffold/templates/view_show.html.erb
|
40
|
+
generators/xd_receiver/xd_receiver_generator.rb
|
41
|
+
generators/xd_receiver/templates/xd_receiver.html
|
42
|
+
init.rb
|
43
|
+
install.rb
|
44
|
+
lib/facebooker.rb
|
45
|
+
lib/facebooker/adapters/adapter_base.rb
|
46
|
+
lib/facebooker/adapters/bebo_adapter.rb
|
47
|
+
lib/facebooker/adapters/facebook_adapter.rb
|
48
|
+
lib/facebooker/admin.rb
|
49
|
+
lib/facebooker/batch_request.rb
|
50
|
+
lib/facebooker/data.rb
|
51
|
+
lib/facebooker/feed.rb
|
52
|
+
lib/facebooker/logging.rb
|
53
|
+
lib/facebooker/model.rb
|
54
|
+
lib/facebooker/models/affiliation.rb
|
55
|
+
lib/facebooker/models/album.rb
|
56
|
+
lib/facebooker/models/applicationproperties.rb
|
57
|
+
lib/facebooker/models/cookie.rb
|
58
|
+
lib/facebooker/models/education_info.rb
|
59
|
+
lib/facebooker/models/event.rb
|
60
|
+
lib/facebooker/models/friend_list.rb
|
61
|
+
lib/facebooker/models/group.rb
|
62
|
+
lib/facebooker/models/info_item.rb
|
63
|
+
lib/facebooker/models/info_section.rb
|
64
|
+
lib/facebooker/models/location.rb
|
65
|
+
lib/facebooker/models/notifications.rb
|
66
|
+
lib/facebooker/models/page.rb
|
67
|
+
lib/facebooker/models/photo.rb
|
68
|
+
lib/facebooker/models/tag.rb
|
69
|
+
lib/facebooker/models/user.rb
|
70
|
+
lib/facebooker/models/work_info.rb
|
71
|
+
lib/facebooker/parser.rb
|
72
|
+
lib/facebooker/rails/controller.rb
|
73
|
+
lib/facebooker/rails/facebook_asset_path.rb
|
74
|
+
lib/facebooker/rails/facebook_form_builder.rb
|
75
|
+
lib/facebooker/rails/facebook_pretty_errors.rb
|
76
|
+
lib/facebooker/rails/facebook_request_fix.rb
|
77
|
+
lib/facebooker/rails/facebook_session_handling.rb
|
78
|
+
lib/facebooker/rails/facebook_url_helper.rb
|
79
|
+
lib/facebooker/rails/facebook_url_rewriting.rb
|
80
|
+
lib/facebooker/rails/helpers.rb
|
81
|
+
lib/facebooker/rails/helpers/fb_connect.rb
|
82
|
+
lib/facebooker/rails/profile_publisher_extensions.rb
|
83
|
+
lib/facebooker/rails/publisher.rb
|
84
|
+
lib/facebooker/rails/routing.rb
|
85
|
+
lib/facebooker/rails/test_helpers.rb
|
86
|
+
lib/facebooker/rails/utilities.rb
|
87
|
+
lib/facebooker/server_cache.rb
|
88
|
+
lib/facebooker/service.rb
|
89
|
+
lib/facebooker/session.rb
|
90
|
+
lib/facebooker/version.rb
|
91
|
+
lib/net/http_multipart_post.rb
|
92
|
+
lib/tasks/facebooker.rake
|
93
|
+
lib/tasks/tunnel.rake
|
94
|
+
rails/init.rb
|
95
|
+
setup.rb
|
96
|
+
templates/layout.erb
|
97
|
+
test/adapters_test.rb
|
98
|
+
test/batch_request_test.rb
|
99
|
+
test/event_test.rb
|
100
|
+
test/facebook_admin_test.rb
|
101
|
+
test/facebook_cache_test.rb
|
102
|
+
test/facebook_data_test.rb
|
103
|
+
test/facebooker_test.rb
|
104
|
+
test/fixtures/multipart_post_body_with_only_parameters.txt
|
105
|
+
test/fixtures/multipart_post_body_with_single_file.txt
|
106
|
+
test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt
|
107
|
+
test/http_multipart_post_test.rb
|
108
|
+
test/logging_test.rb
|
109
|
+
test/model_test.rb
|
110
|
+
test/publisher_test.rb
|
111
|
+
test/rails_integration_test.rb
|
112
|
+
test/session_test.rb
|
113
|
+
test/test_helper.rb
|
114
|
+
test/user_test.rb
|
data/README
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Copyright (c) 2007 Chad Fowler, Patrick Ewing
|
2
|
+
|
3
|
+
= Facebooker
|
4
|
+
|
5
|
+
Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://developer.facebook.com]. Its goals are:
|
6
|
+
|
7
|
+
* Idiomatic Ruby
|
8
|
+
* No dependencies outside of the Ruby standard library (This is true with Rails 2.1. Previous Rails versions require the JSON gem)
|
9
|
+
* Concrete classes and methods modeling the Facebook data, so it's easy for a Rubyist to understand what's available
|
10
|
+
* Well tested
|
11
|
+
|
12
|
+
= Installing (Non Rails)
|
13
|
+
|
14
|
+
The best way is:
|
15
|
+
|
16
|
+
gem install facebooker
|
17
|
+
|
18
|
+
If, for some reason, you can't/won't use RubyGems, you can do:
|
19
|
+
|
20
|
+
(sudo) ruby setup.rb
|
21
|
+
|
22
|
+
= Installing (Rails)
|
23
|
+
|
24
|
+
Facebooker can be installed as a Rails plugin by:
|
25
|
+
|
26
|
+
script/plugin install git://github.com/mmangino/facebooker.git
|
27
|
+
|
28
|
+
If you don't have git, the plugin can be downloaded from http://github.com/mmangino/facebooker/tarball/master
|
29
|
+
|
30
|
+
Once the plugin is installed, you will need to configure your Facebook app in config/facebooker.yml.
|
31
|
+
|
32
|
+
Your application users will need to have added the application in facebook to access all of facebooker's features. You enforce this by adding
|
33
|
+
|
34
|
+
ensure_application_is_installed_by_facebook_user
|
35
|
+
|
36
|
+
to your application controller.
|
37
|
+
|
38
|
+
|
39
|
+
== Work in Progress
|
40
|
+
|
41
|
+
I'm not saying it meets its goals fully yet. Please help. I'm especially interested in feedback and criticism re: Ruby style and design and testing. RCov has the library (at the time of this writing) at 100% coverage. I take that with a grain of salt, but it's a good start.
|
42
|
+
|
43
|
+
== Contribute
|
44
|
+
|
45
|
+
Please visit the {RubyForge project page}[http://rubyforge.org/projects/facebooker] to get the latest source via svn, write some tests, add/fix features, and submit a patch via the tracker. If you submit a good patch, it's likely that I'll add you to the project for commit access if you want to be added.
|
46
|
+
|
data/README.txt
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
= facebooker
|
2
|
+
|
3
|
+
* http://facebooker.rubyforge.org
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://wiki.developers.facebook.com/index.php/API]. Its goals are:
|
8
|
+
|
9
|
+
* Idiomatic Ruby
|
10
|
+
* No dependencies outside of the Ruby standard library (This is true with Rails 2.1. Previous Rails versions require the JSON gem)
|
11
|
+
* Concrete classes and methods modeling the Facebook data, so it's easy for a Rubyist to understand what's available
|
12
|
+
* Well tested
|
13
|
+
|
14
|
+
|
15
|
+
== FEATURES/PROBLEMS:
|
16
|
+
|
17
|
+
* Idiomatic Ruby
|
18
|
+
* No dependencies outside of the Ruby standard library
|
19
|
+
* Concrete classes and methods modeling the Facebook data, so it's easy for a Rubyist to understand what's available
|
20
|
+
* Well tested
|
21
|
+
|
22
|
+
== SYNOPSIS:
|
23
|
+
|
24
|
+
View David Clements' {excellent tutorial}[http://apps.facebook.com/facebooker_tutorial] at {http://apps.facebook.com/facebooker_tutorial/}[http://apps.facebook.com/facebooker_tutorial] or check out {Developing Facebook Platform Applications with Rails}[http://www.pragprog.com/titles/mmfacer].
|
25
|
+
|
26
|
+
== REQUIREMENTS:
|
27
|
+
|
28
|
+
None
|
29
|
+
|
30
|
+
== INSTALL:
|
31
|
+
|
32
|
+
* Non Rails
|
33
|
+
|
34
|
+
The best way is:
|
35
|
+
|
36
|
+
gem install facebooker
|
37
|
+
|
38
|
+
If, for some reason, you can't/won't use RubyGems, you can do:
|
39
|
+
|
40
|
+
(sudo) ruby setup.rb
|
41
|
+
|
42
|
+
* Rails
|
43
|
+
|
44
|
+
Facebooker can be installed as a Rails plugin by:
|
45
|
+
|
46
|
+
script/plugin install git://github.com/mmangino/facebooker.git
|
47
|
+
|
48
|
+
If you don't have git, the plugin can be downloaded from http://github.com/mmangino/facebooker/tarball/master
|
49
|
+
|
50
|
+
Once the plugin is installed, you will need to configure your Facebook app in config/facebooker.yml.
|
51
|
+
|
52
|
+
Your application users will need to have added the application in facebook to access all of facebooker's features. You enforce this by adding
|
53
|
+
|
54
|
+
ensure_application_is_installed_by_facebook_user
|
55
|
+
|
56
|
+
to your application controller.
|
57
|
+
|
58
|
+
== using MemCache session
|
59
|
+
|
60
|
+
Facebook uses some non alphanum characters in the session identifier which interfere with memcache stored sessions. If you want to use MemCache for storing sessions, you can override the valid session id method on memcache by placing the following code in an initializer:
|
61
|
+
|
62
|
+
# add - as an okay key
|
63
|
+
class CGI
|
64
|
+
class Session
|
65
|
+
class MemCacheStore
|
66
|
+
def check_id(id) #:nodoc:#
|
67
|
+
/[^0-9a-zA-Z\-\._]+/ =~ id.to_s ? false : true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
== LICENSE:
|
75
|
+
|
76
|
+
(The MIT License)
|
77
|
+
|
78
|
+
Copyright (c) 2008 FIX
|
79
|
+
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
81
|
+
a copy of this software and associated documentation files (the
|
82
|
+
'Software'), to deal in the Software without restriction, including
|
83
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
84
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
85
|
+
permit persons to whom the Software is furnished to do so, subject to
|
86
|
+
the following conditions:
|
87
|
+
|
88
|
+
The above copyright notice and this permission notice shall be
|
89
|
+
included in all copies or substantial portions of the Software.
|
90
|
+
|
91
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
92
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
93
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
94
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
95
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
96
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
97
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
#
|
3
|
+
require 'rubygems'
|
4
|
+
ENV['RUBY_FLAGS']="-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}"
|
5
|
+
require 'hoe'
|
6
|
+
$: << File.dirname(__FILE__) + '/lib'
|
7
|
+
require './lib/facebooker.rb'
|
8
|
+
|
9
|
+
Hoe.new('facebooker', Facebooker::VERSION::STRING) do |p|
|
10
|
+
p.rubyforge_name = 'facebooker'
|
11
|
+
p.author = ['Chad Fowler', 'Patrick Ewing', 'Mike Mangino', 'Shane Vitarana', 'Corey Innis']
|
12
|
+
p.email = 'mmangino@elevatedrails.com'
|
13
|
+
p.summary = 'Pure, idiomatic Ruby wrapper for the Facebook REST API.'
|
14
|
+
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
15
|
+
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
16
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
17
|
+
p.remote_rdoc_dir = '' # Release to root
|
18
|
+
p.test_globs = 'test/*.rb'
|
19
|
+
p.extra_deps << ['json', '>= 1.0.0']
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'rcov/rcovtask'
|
23
|
+
|
24
|
+
namespace :test do
|
25
|
+
namespace :coverage do
|
26
|
+
desc "Delete aggregate coverage data."
|
27
|
+
task(:clean) { rm_f "coverage.data" }
|
28
|
+
end
|
29
|
+
desc 'Aggregate code coverage for unit, functional and integration tests'
|
30
|
+
Rcov::RcovTask.new(:coverage) do |t|
|
31
|
+
t.libs << "test"
|
32
|
+
t.test_files = FileList["test/*.rb"]
|
33
|
+
t.output_dir = "coverage/"
|
34
|
+
t.verbose = true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
gem_spec_file = 'facebooker.gemspec'
|
39
|
+
|
40
|
+
gem_spec = eval(File.read(gem_spec_file)) rescue nil
|
41
|
+
|
42
|
+
desc "Generate the gemspec file."
|
43
|
+
task :gemspec do
|
44
|
+
require 'erb'
|
45
|
+
|
46
|
+
File.open(gem_spec_file, 'w') do |f|
|
47
|
+
f.write ERB.new(File.read("#{gem_spec_file}.erb")).result(binding)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# vim: syntax=Ruby
|
52
|
+
#
|
53
|
+
#
|
54
|
+
# require File.dirname(__FILE__) + '/vendor/gardener/lib/gardener'
|
55
|
+
#
|
56
|
+
# require 'facebooker'
|
57
|
+
#
|
58
|
+
# namespace :doc do
|
59
|
+
# task :readme do
|
60
|
+
# puts "Readme"
|
61
|
+
# end
|
62
|
+
# end
|
63
|
+
#
|
64
|
+
# Gardener.configure do
|
65
|
+
# gem_spec do |spec|
|
66
|
+
# spec.name = 'facebooker'
|
67
|
+
# spec.version = Gem::Version.new(Facebooker::VERSION::STRING)
|
68
|
+
# spec.summary = "Pure, idiomatic Ruby wrapper for the Facebook REST API."
|
69
|
+
# spec.email = 'chad@infoether.com'
|
70
|
+
# spec.author = ['Chad Fowler', 'Patrick Ewing','Mike Mangino','Shane Vitarana']
|
71
|
+
# spec.extra_rdoc_files = %w(COPYING)
|
72
|
+
# spec.rdoc_options = ['--title', "Gardener",
|
73
|
+
# '--main', 'README',
|
74
|
+
# '--line-numbers', '--inline-source']
|
75
|
+
# end
|
76
|
+
# end
|
data/TODO.txt
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
[ ] Refactor facebook form builder so erbout won't be deeply nested, causing erubis to break
|
2
|
+
[ ] Support missing parameters on methods---most notably authentication-related parameters such as next and canvas
|
3
|
+
[ ] Finish FQL Querying
|
4
|
+
[ ] Refactor FQL Querying
|
5
|
+
[ ] Transform incoming data into appropriate classes (Integers, Dates, etc.)
|
6
|
+
|
7
|
+
[x] Specify fields wanted when getting user info (defaults to all now) [shane]
|
8
|
+
[x] Create facebooker.yml config file and merge with tunnel.yml [shane]
|
9
|
+
[X] Remove facebook prefix from resource routes, making them worth with facebook and regular Rails controllers [mike]
|
10
|
+
[X] Use fb_sig_request_method to make facebook routes more Rails-like [mike]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class FacebookGenerator < Rails::Generator::Base
|
2
|
+
def manifest
|
3
|
+
record do |m|
|
4
|
+
m.file 'config/facebooker.yml', 'config/facebooker.yml'
|
5
|
+
m.file 'public/javascripts/facebooker.js', 'public/javascripts/facebooker.js'
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
protected
|
10
|
+
|
11
|
+
def banner
|
12
|
+
"Usage: #{$0} facebooker"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# The api key, secret key, and canvas page name are required to get started
|
2
|
+
# Tunnel configuration is only needed if you are going to use the facebooker:tunnel Rake tasks
|
3
|
+
# Your callback url in Facebook should be set to http://public_host:public_port
|
4
|
+
# If you're building a Facebook connect site,
|
5
|
+
# change the value of set_asset_host_to_callback_url to false
|
6
|
+
# To develop for the new profile design, add the following key..
|
7
|
+
# api: new
|
8
|
+
# remove the key or set it to anything else to use the old facebook design.
|
9
|
+
# This should only be necessary until the final version of the new profile is released.
|
10
|
+
|
11
|
+
development:
|
12
|
+
api_key:
|
13
|
+
secret_key:
|
14
|
+
canvas_page_name:
|
15
|
+
callback_url:
|
16
|
+
pretty_errors: true
|
17
|
+
set_asset_host_to_callback_url: true
|
18
|
+
tunnel:
|
19
|
+
public_host_username:
|
20
|
+
public_host:
|
21
|
+
public_port: 4007
|
22
|
+
local_port: 3000
|
23
|
+
|
24
|
+
test:
|
25
|
+
api_key:
|
26
|
+
secret_key:
|
27
|
+
canvas_page_name:
|
28
|
+
callback_url:
|
29
|
+
set_asset_host_to_callback_url: true
|
30
|
+
tunnel:
|
31
|
+
public_host_username:
|
32
|
+
public_host:
|
33
|
+
public_port: 4007
|
34
|
+
local_port: 3000
|
35
|
+
|
36
|
+
production:
|
37
|
+
api_key:
|
38
|
+
secret_key:
|
39
|
+
canvas_page_name:
|
40
|
+
callback_url:
|
41
|
+
set_asset_host_to_callback_url: true
|
42
|
+
tunnel:
|
43
|
+
public_host_username:
|
44
|
+
public_host:
|
45
|
+
public_port: 4007
|
46
|
+
local_port: 3000
|