twitter 5.16.0 → 5.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/twitter/client.rb +1 -1
- data/lib/twitter/null_object.rb +6 -2
- data/lib/twitter/rest/media.rb +1 -1
- data/lib/twitter/rest/request/multipart_with_file.rb +6 -4
- data/lib/twitter/rest/response/raise_error.rb +2 -5
- data/lib/twitter/rest/tweets.rb +1 -1
- data/lib/twitter/streaming/event.rb +1 -1
- data/lib/twitter/streaming/response.rb +1 -1
- data/lib/twitter/tweet.rb +1 -0
- data/lib/twitter/user.rb +1 -1
- data/lib/twitter/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96813c8d87955909e3fd553015e5d1fa44164e08
|
4
|
+
data.tar.gz: dd5e3c91a697c46e39067e60adc5cc67ecb8b5f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc47aaae84bab581a62f460a9bad40ccf758fcbda1b4f38091b323acb8fdd2aabd9725f96d8c373c2cf33a1204d72851400f1f087abd36f81f7f355848786c65
|
7
|
+
data.tar.gz: 41fcb0e2aee2ba8db3a379dee590ab99ba62788179908c30062893be05341ffa3cdf418bc3e480d701e49208a35a6d61cd7c2421511f223355847cb2a869cbc2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
5.17.0
|
2
|
+
------
|
3
|
+
* [Add `email` to `Twitter::User`](https://github.com/sferik/twitter/commit/1d3aebcd0186d36c7c657ec913ac73bfa802d6ff)
|
4
|
+
* [Add `current_user_retweet` attribute to `Twitter::Tweet`](https://github.com/sferik/twitter/pull/819) ([@ysr227](https://twitter.com/ysr227))
|
5
|
+
* [Add `quoted_tweet` Twitter::Streaming::Event](https://github.com/sferik/twitter/pull/800)
|
6
|
+
* [Dump `Twitter::NullObject` as JSON properly](https://github.com/sferik/twitter/pull/815) ([@okkez](https://twitter.com/okkez))
|
7
|
+
|
1
8
|
5.16.0
|
2
9
|
------
|
3
10
|
* [Add new settings to `Twitter::Settings`](https://github.com/sferik/twitter/commit/d047ce00034d26a99927076c28679ce08fd69308)
|
data/lib/twitter/client.rb
CHANGED
@@ -60,7 +60,7 @@ module Twitter
|
|
60
60
|
def validate_credentials!
|
61
61
|
credentials.each do |credential, value|
|
62
62
|
next if value.nil? || value == true || value == false || value.is_a?(String)
|
63
|
-
|
63
|
+
raise(Twitter::Error::ConfigurationError.new("Invalid #{credential} specified: #{value.inspect} must be a String."))
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
data/lib/twitter/null_object.rb
CHANGED
@@ -19,12 +19,12 @@ module Twitter
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def instance_of?(klass)
|
22
|
-
|
22
|
+
raise(TypeError.new('class or module required')) unless klass.is_a?(Class)
|
23
23
|
self.class == klass
|
24
24
|
end
|
25
25
|
|
26
26
|
def kind_of?(mod)
|
27
|
-
|
27
|
+
raise(TypeError.new('class or module required')) unless mod.is_a?(Module)
|
28
28
|
self.class.ancestors.include?(mod)
|
29
29
|
end
|
30
30
|
|
@@ -45,5 +45,9 @@ module Twitter
|
|
45
45
|
def as_json(*)
|
46
46
|
'null'
|
47
47
|
end
|
48
|
+
|
49
|
+
def to_json(*args)
|
50
|
+
nil.to_json(*args)
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
data/lib/twitter/rest/media.rb
CHANGED
@@ -16,7 +16,7 @@ module Twitter
|
|
16
16
|
# @param media [File, Hash] A File object with your picture (PNG, JPEG or GIF)
|
17
17
|
# @param options [Hash] A customizable set of options.
|
18
18
|
def upload(media, options = {})
|
19
|
-
|
19
|
+
raise(Twitter::Error::UnacceptableIO.new) unless media.respond_to?(:to_io)
|
20
20
|
base_url = 'https://upload.twitter.com'
|
21
21
|
path = '/1.1/media/upload.json'
|
22
22
|
conn = connection.dup
|
@@ -12,10 +12,12 @@ module Twitter
|
|
12
12
|
WEBP_REGEX = /\.webp/i
|
13
13
|
|
14
14
|
def call(request)
|
15
|
-
request.body.
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
if request.body.is_a?(::Hash)
|
16
|
+
request.body.each do |key, value|
|
17
|
+
next unless value.respond_to?(:to_io)
|
18
|
+
request.body[key] = Faraday::UploadIO.new(value, mime_type(value.path), value.path)
|
19
|
+
end
|
20
|
+
end
|
19
21
|
@app.call(request)
|
20
22
|
end
|
21
23
|
|
@@ -9,11 +9,8 @@ module Twitter
|
|
9
9
|
status_code = response.status.to_i
|
10
10
|
klass = Twitter::Error.errors[status_code]
|
11
11
|
return unless klass
|
12
|
-
if klass == Twitter::Error::Forbidden
|
13
|
-
|
14
|
-
else
|
15
|
-
fail(klass.from_response(response))
|
16
|
-
end
|
12
|
+
raise(handle_forbidden_errors(response)) if klass == Twitter::Error::Forbidden
|
13
|
+
raise(klass.from_response(response))
|
17
14
|
end
|
18
15
|
|
19
16
|
private
|
data/lib/twitter/rest/tweets.rb
CHANGED
@@ -226,7 +226,7 @@ module Twitter
|
|
226
226
|
# @option options [String] :display_coordinates Whether or not to put a pin on the exact coordinates a tweet has been sent from.
|
227
227
|
# @option options [Boolean, String, Integer] :trim_user Each tweet returned in a timeline will include a user object with only the author's numerical ID when set to true, 't' or 1.
|
228
228
|
def update_with_media(status, media, options = {})
|
229
|
-
|
229
|
+
raise(Twitter::Error::UnacceptableIO.new) unless media.respond_to?(:to_io)
|
230
230
|
hash = options.dup
|
231
231
|
hash[:in_reply_to_status_id] = hash.delete(:in_reply_to_status).id unless hash[:in_reply_to_status].nil?
|
232
232
|
hash[:place_id] = hash.delete(:place).woeid unless hash[:place].nil?
|
data/lib/twitter/tweet.rb
CHANGED
@@ -21,6 +21,7 @@ module Twitter
|
|
21
21
|
object_attr_reader :Place, :place
|
22
22
|
object_attr_reader :Tweet, :retweeted_status
|
23
23
|
object_attr_reader :Tweet, :quoted_status
|
24
|
+
object_attr_reader :Tweet, :current_user_retweet
|
24
25
|
alias retweeted_tweet retweeted_status
|
25
26
|
alias retweet? retweeted_status?
|
26
27
|
alias retweeted_tweet? retweeted_status?
|
data/lib/twitter/user.rb
CHANGED
@@ -16,7 +16,7 @@ module Twitter
|
|
16
16
|
attr_reader :favourites_count, :followers_count, :friends_count,
|
17
17
|
:listed_count, :statuses_count, :utc_offset
|
18
18
|
# @return [String]
|
19
|
-
attr_reader :description, :lang, :location, :name,
|
19
|
+
attr_reader :description, :email, :lang, :location, :name,
|
20
20
|
:profile_background_color, :profile_link_color,
|
21
21
|
:profile_sidebar_border_color, :profile_sidebar_fill_color,
|
22
22
|
:profile_text_color, :time_zone
|
data/lib/twitter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Michaels-Ober
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-
|
15
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: addressable
|
@@ -289,9 +289,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
289
|
version: 1.3.5
|
290
290
|
requirements: []
|
291
291
|
rubyforge_project:
|
292
|
-
rubygems_version: 2.5.
|
292
|
+
rubygems_version: 2.5.2
|
293
293
|
signing_key:
|
294
294
|
specification_version: 4
|
295
295
|
summary: A Ruby interface to the Twitter API.
|
296
296
|
test_files: []
|
297
|
-
has_rdoc:
|