rest-more 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: 5d7d25f35f71824a54722882781fec66d4a0f0d7
4
- data.tar.gz: 162468ea7578ce061ed9b9ebcc71b510eb610313
3
+ metadata.gz: f6c1734aa90af4216bde1eb8b94091ccdc5fae97
4
+ data.tar.gz: 40483e18c8ae3c9c638335732066b5f4318836a7
5
5
  !binary "U0hBNTEy":
6
- metadata.gz: 263040498b133b04aaa64cf6d808cc95ea93b2cc6902f702a4354d7f4f92cb2f8ab706ed3bdf6681380ae9ccc8e888f9a5129ef8808741ad0906a56e500071b0
7
- data.tar.gz: daf111d5deafae6196d8c70a0d7d89d76f799bde3ee7991df828d39997a0b9e78e7b980c79f859e29cb381191734a42eb29eb227975afbfc3ea34355e5b6d349
6
+ metadata.gz: bb36d1c9cc01564aa5225f81593ef18395689b72de1aec9c95f797c5df77cf1bade26e4455cfb0d232efedc90c8238b6df96c330c28107bcef22f5805660aeb3
7
+ data.tar.gz: e96d8a2ec4501e0d56b3a6f9bd125a7c46ae5bd6aa40e7cb5c894b7b5b363d2c454d2214666b84f2b86fd0a00d193c77da1f886f31c8fa4ba77c732ae3d4e488
data/CHANGES.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGES
2
2
 
3
+ ## rest-more 2.0.4 -- 2013-04-13
4
+
5
+ * [Facebook::RailsUtil] Since now that we cannot retrieve the access token
6
+ from cookie directly, we need to exchange it with the code in cookie,
7
+ and then save it to our own storage. This fixed some issues with Facebook
8
+ JavaScript SDK used together.
9
+
10
+ * [Facebook::RailsUtil] Changed the order checking access token, so that
11
+ we don't have to exchange the access token every time.
12
+
13
+ * [Twitter] Adopted Twitter API 1.1, thanks @khoan.
14
+
3
15
  ## rest-more 2.0.3 -- 2013-04-01
4
16
 
5
17
  * Fixed compatibility with Ruby 2.0.
data/README.md CHANGED
@@ -169,6 +169,7 @@ Which is using `RestCore::Universal` for accessing arbitrary websites.
169
169
 
170
170
  * ayaya (@ayamomiji)
171
171
  * Fumin (@fumin)
172
+ * khoa nguyen (@khoan)
172
173
  * Lin Jen-Shin (@godfat)
173
174
  * Yun-Yan Chi (@jaiyalas)
174
175
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  source 'http://rubygems.org'
3
3
 
4
- gem 'rails', '3.2.12'
4
+ gem 'rails', '3.2.13'
5
5
 
6
6
  gem 'rest-client' # for rest-core
7
7
  gem 'rest-core', :path => '../../rest-core'
@@ -35,16 +35,9 @@ module RestCore::Facebook::RailsUtil
35
35
 
36
36
  rc_facebook_check_params_signed_request # canvas
37
37
  rc_facebook_check_params_session # i think it would be deprecated
38
- rc_facebook_check_cookie # for js sdk (canvas or not)
39
38
  rc_facebook_check_code # oauth api
40
-
41
- # there are above 4 ways to check the user identity!
42
- # if nor of them passed, then we can suppose the user
43
- # didn't authorize for us, but we can check if user has authorized
44
- # before, in that case, the fbs would be inside session,
45
- # as we just saved it there
46
-
47
- rc_facebook_check_fbs # check rc_facebook storage
39
+ rc_facebook_check_fbs # check rc_facebook storage
40
+ rc_facebook_check_cookie # for js sdk (canvas or not)
48
41
 
49
42
  if rc_options_get(RestCore::Facebook, :ensure_authorized) &&
50
43
  !rc_facebook.authorized?
@@ -168,6 +161,8 @@ module RestCore::Facebook::RailsUtil
168
161
  rc_facebook.parse_cookies!(cookies)
169
162
  logger.debug("DEBUG: Facebook: detected cookies, parsed:" \
170
163
  " #{rc_facebook.data.inspect}")
164
+
165
+ rc_facebook_write_fbs if rc_facebook.authorized?
171
166
  end
172
167
 
173
168
  # exchange the code with access_token
@@ -66,23 +66,27 @@ module RestCore::Twitter::Client
66
66
  include RestCore
67
67
 
68
68
  def me query={}, opts={}
69
- get('1/account/verify_credentials.json', query, opts)
69
+ get('1.1/account/verify_credentials.json', query, opts)
70
70
  end
71
71
 
72
72
  def tweet status, media=nil, payload={}, query={}, opts={}
73
73
  if media
74
- post('https://upload.twitter.com/1/statuses/update_with_media.json',
74
+ post('1.1/statuses/update_with_media.json',
75
75
  {:status => status, 'media[]' => media}.merge(payload),
76
76
  query, opts)
77
77
  else
78
- post('1/statuses/update.json',
78
+ post('1.1/statuses/update.json',
79
79
  {:status => status}.merge(payload),
80
80
  query, opts)
81
81
  end
82
82
  end
83
83
 
84
+ def search q, query={}, opts={}
85
+ get('1.1/search/tweets.json', {q: q}.merge(query), opts)
86
+ end
87
+
84
88
  def statuses user, query={}, opts={}
85
- get('1/statuses/user_timeline.json', {:id => user}.merge(query), opts)
89
+ get('1.1/statuses/user_timeline.json', {:id => user}.merge(query), opts)
86
90
  end
87
91
  end
88
92
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  module RestMore
3
- VERSION = '2.0.3'
3
+ VERSION = '2.0.4'
4
4
  end
data/rest-more.gemspec CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rest-more"
5
- s.version = "2.0.3"
5
+ s.version = "2.0.4"
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
  "Cardinal Blue",
10
10
  "Lin Jen-Shin (godfat)"]
11
- s.date = "2013-04-01"
11
+ s.date = "2013-04-13"
12
12
  s.description = "Various REST clients such as Facebook and Twitter built with [rest-core][]\n\n[rest-core]: https://github.com/cardinalblue/rest-core"
13
13
  s.email = ["dev (XD) cardinalblue.com"]
14
14
  s.executables = ["rib-rest-core"]
@@ -9,7 +9,7 @@ describe RC::Twitter do
9
9
 
10
10
  should 'get right' do
11
11
  stub_request(:get,
12
- 'https://api.twitter.com/1/account/verify_credentials.json').
12
+ 'https://api.twitter.com/1.1/account/verify_credentials.json').
13
13
  to_return(:body => '{"status": "OK"}')
14
14
 
15
15
  RC::Twitter.new.me.should.eq({'status' => 'OK'})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-more
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cardinal Blue
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
12
+ date: 2013-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-core