Jump to content

(Archived) evernote_oauth_simple.rb doesn't work with ruby 1.9


Recommended Posts

evernote-api-1.19/ruby/sample/oauth/evernote_oauth_simple.rb doesn't work with ruby 1.9 because of API change between ruby 1.8.x and 1.9.x. See http://www.eggheadcafe.com/microsoft/Ru ... -post.aspx for more details.

Here is the patch. It works with ruby 1.8.7 (patchlevel 174) and 1.9.2p290 for me.

--- evernote-api-1.19/ruby/lib/thrift/transport/http_client_transport.rb.orig 2010-08-05 15:12:01.000000000 -0700

+++ evernote-api-1.19/ruby/lib/thrift/transport/http_client_transport.rb 2011-09-27 19:06:10.000000000 -0700

@@ -43,7 +43,10 @@

def flush

http = Net::HTTP.new @url.host, @url.port

http.use_ssl = @url.scheme == "https"

- resp, data = http.post(@url.request_uri, @outbuf, @headers)

+ resp = http.post(@url.request_uri, @outbuf, @headers)

+ if !resp.nil?

+ data = resp.body

+ end

@inbuf = StringIO.new data

@outbuf = ""

end

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...