Skip to content
Permalink
Browse files

document, version bump, gemspec bump, Gemfile.lock bump

  • Loading branch information...
godfat committed Sep 30, 2010
1 parent c9aa964 commit 64804a7b8f5c56c63a2b5fe1da9f1473c887cefa
Showing with 31 additions and 19 deletions.
  1. +16 −11 CHANGES
  2. +1 −1 Gemfile.lock
  3. +7 −0 README.rdoc
  4. +1 −1 lib/rest-graph/version.rb
  5. +6 −6 rest-graph.gemspec
27 CHANGES
@@ -1,6 +1,6 @@
= rest-graph changes history

== rest-graph 1.4.7 -- ?
== rest-graph 1.5.0 -- ?

* [RestGraph] Make sure RestGraph::Error#message is string, that way,
irb could print out error message correctly. Introduced
@@ -26,30 +26,35 @@ http://groups.google.com/group/rest-graph/browse_thread/thread/7ad5c81fbb0334e8

rg.for_pages(rg.get('me/feed'), 1000)

* [RestGraph] Added RestGraph#broken_old_rest, see:
* [RestGraph] Added RestGraph#secret_old_rest, see:
http://www.nivas.hr/blog/2010/09/03/facebook-php-sdk-access-token-signing-bug/

If you're getting this error from calling old_rest:

The method you are calling or the FQL table you are querying cannot be
called using a session secret or by a desktop application.

Then try broken_old_rest instead. The problem is that the access_token
should be formatted by "#{app_id}|#{secret}" instead of the usual one,
and the JSON returned by Facebook is broken too, need to remove the
quotes and the extra '\'. For instance:
Then try secret_old_rest instead. The problem is that the access_token
should be formatted by "#{app_id}|#{secret}" instead of the usual one.

"{\"app_id\":\"123\"}"
* [RestGraph] Added RestGraph#broken_old_rest. This is essentially the same
as secret_old_rest with :double_decode turned on by default.
In some API, e.g. admin.getAppProperties, Facebook returns
broken JSON, which is double encoded, and is not a well-formed
JSON. That case, we'll need to double parse the JSON to get
the correct result. For example, Facebook might return this:

instead of the correct one:
"{\"app_id\":\"123\"}"

{"app_id":"123"}
instead of the correct one:

{"app_id":"123"}

P.S. This doesn't matter for people who don't use :auto_decode.

So, there are two hacks in broken_old_rest. One is faking access_token,
the other one is fix the JSON by removing extra quotes and the '\'.

This applied to admin.getAppProperties.

* [RestGraph] Fallback to ruby-hmac gem if we have an old openssl lib when
parsing signed_request which requires HMAC SHA256.
(e.g. Mac OS 10.5) Thanks Barnabas Debreczeni!
@@ -15,7 +15,7 @@ GEM
webmock (1.3.5)
addressable (>= 2.1.1)
crack (>= 0.1.7)
yajl-ruby (0.7.7)
yajl-ruby (0.7.8)

PLATFORMS
ruby
@@ -238,6 +238,13 @@ Call functionality from Facebook's old REST API:
:suppress_decode => true) # You'll need to set suppress_decode to true
# if Facebook is not returning a proper JSON
# response. Otherwise, this could be omitted.
# You might need to pass :double_decode => true
# if the broken JSON is just double encoded.

# Some Old Rest API requires a special access token with app secret
# inside of it. For those methods, use secret_old_rest instead of the
# usual old_rest with common access token.
rg.secret_old_rest('admin.getAppProperties', :properties => 'app_id')

=== Utility Methods:

@@ -1,4 +1,4 @@

require 'rest-graph'

RestGraph::VERSION = '1.4.7'
RestGraph::VERSION = '1.5.0'
@@ -2,15 +2,15 @@

Gem::Specification.new do |s|
s.name = %q{rest-graph}
s.version = "1.4.7"
s.version = "1.5.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Cardinal Blue", "Lin Jen-Shin (aka godfat 真常)"]
s.date = %q{2010-09-16}
s.date = %q{2010-09-30}
s.description = %q{A super simple Facebook Open Graph API client}
s.email = %q{dev (XD) cardinalblue.com}
s.extra_rdoc_files = ["CHANGES", "CONTRIBUTORS", "Gemfile", "Gemfile.lock", "LICENSE", "README", "TODO", "rest-graph.gemspec"]
s.files = ["CHANGES", "CONTRIBUTORS", "Gemfile", "Gemfile.lock", "LICENSE", "README", "README.rdoc", "Rakefile", "TODO", "example/rails2/README", "example/rails2/Rakefile", "example/rails2/app/controllers/application_controller.rb", "example/rails2/config/boot.rb", "example/rails2/config/environment.rb", "example/rails2/config/environments/development.rb", "example/rails2/config/environments/production.rb", "example/rails2/config/environments/test.rb", "example/rails2/config/initializers/cookie_verification_secret.rb", "example/rails2/config/initializers/new_rails_defaults.rb", "example/rails2/config/initializers/session_store.rb", "example/rails2/config/rest-graph.yaml", "example/rails2/config/routes.rb", "example/rails2/log", "example/rails2/script/console", "example/rails2/script/server", "example/rails2/test/functional/application_controller_test.rb", "example/rails2/test/test_helper.rb", "example/rails2/test/unit/rails_util_test.rb", "init.rb", "lib/rest-graph.rb", "lib/rest-graph/auto_load.rb", "lib/rest-graph/load_config.rb", "lib/rest-graph/rails_util.rb", "lib/rest-graph/version.rb", "rest-graph.gemspec", "test/common.rb", "test/config/rest-graph.yaml", "test/test_api.rb", "test/test_cache.rb", "test/test_default.rb", "test/test_error.rb", "test/test_handler.rb", "test/test_load_config.rb", "test/test_misc.rb", "test/test_oauth.rb", "test/test_old.rb", "test/test_page.rb", "test/test_parse.rb", "test/test_rest-graph.rb", "test/test_serialize.rb"]
s.files = ["CHANGES", "CONTRIBUTORS", "Gemfile", "Gemfile.lock", "LICENSE", "README", "README.rdoc", "Rakefile", "TODO", "example/rails2/README", "example/rails2/Rakefile", "example/rails2/app/controllers/application_controller.rb", "example/rails2/config/boot.rb", "example/rails2/config/environment.rb", "example/rails2/config/environments/development.rb", "example/rails2/config/environments/production.rb", "example/rails2/config/environments/test.rb", "example/rails2/config/initializers/cookie_verification_secret.rb", "example/rails2/config/initializers/new_rails_defaults.rb", "example/rails2/config/initializers/session_store.rb", "example/rails2/config/rest-graph.yaml", "example/rails2/config/routes.rb", "example/rails2/doc/README_FOR_APP", "example/rails2/log", "example/rails2/script/console", "example/rails2/script/server", "example/rails2/test/functional/application_controller_test.rb", "example/rails2/test/test_helper.rb", "example/rails2/test/unit/rails_util_test.rb", "init.rb", "lib/rest-graph.rb", "lib/rest-graph/auto_load.rb", "lib/rest-graph/load_config.rb", "lib/rest-graph/rails_util.rb", "lib/rest-graph/version.rb", "rest-graph.gemspec", "test/common.rb", "test/config/rest-graph.yaml", "test/test_api.rb", "test/test_cache.rb", "test/test_default.rb", "test/test_error.rb", "test/test_handler.rb", "test/test_load_config.rb", "test/test_misc.rb", "test/test_oauth.rb", "test/test_old.rb", "test/test_page.rb", "test/test_parse.rb", "test/test_rest-graph.rb", "test/test_serialize.rb"]
s.homepage = %q{http://github.com/cardinalblue/rest-graph}
s.rdoc_options = ["--main", "README.rdoc"]
s.require_paths = ["lib"]
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rest-client>, [">= 1.6.1"])
s.add_development_dependency(%q<rack>, [">= 1.2.1"])
s.add_development_dependency(%q<yajl-ruby>, [">= 0.7.7"])
s.add_development_dependency(%q<yajl-ruby>, [">= 0.7.8"])
s.add_development_dependency(%q<json>, [">= 1.4.6"])
s.add_development_dependency(%q<json_pure>, [">= 1.4.6"])
s.add_development_dependency(%q<ruby-hmac>, [">= 0.4.0"])
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
else
s.add_dependency(%q<rest-client>, [">= 1.6.1"])
s.add_dependency(%q<rack>, [">= 1.2.1"])
s.add_dependency(%q<yajl-ruby>, [">= 0.7.7"])
s.add_dependency(%q<yajl-ruby>, [">= 0.7.8"])
s.add_dependency(%q<json>, [">= 1.4.6"])
s.add_dependency(%q<json_pure>, [">= 1.4.6"])
s.add_dependency(%q<ruby-hmac>, [">= 0.4.0"])
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
else
s.add_dependency(%q<rest-client>, [">= 1.6.1"])
s.add_dependency(%q<rack>, [">= 1.2.1"])
s.add_dependency(%q<yajl-ruby>, [">= 0.7.7"])
s.add_dependency(%q<yajl-ruby>, [">= 0.7.8"])
s.add_dependency(%q<json>, [">= 1.4.6"])
s.add_dependency(%q<json_pure>, [">= 1.4.6"])
s.add_dependency(%q<ruby-hmac>, [">= 0.4.0"])

0 comments on commit 64804a7

Please sign in to comment.
You can’t perform that action at this time.