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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c196f0dcc5339f83bec5f1ee333691352550d30a
4
- data.tar.gz: 82960f248de8016773dc44fc0f90144e27f5c1ff
3
+ metadata.gz: 96813c8d87955909e3fd553015e5d1fa44164e08
4
+ data.tar.gz: dd5e3c91a697c46e39067e60adc5cc67ecb8b5f4
5
5
  SHA512:
6
- metadata.gz: 075f2d6c0b5f09a207f87e9d7dd45ecae57b949a2a9519cf4ba6db4d7db21215b68260d43d11b428029dda86259bb238318ee6529bf66597f702324903a29c60
7
- data.tar.gz: 126dbaf92971a634d7b7d8875eae3d3fe5eac79e553dcab18308e7988d4242ea14c81a8362ee2505bbd5244e7dc1bef170023332f44115958acd27f31b2b9564
6
+ metadata.gz: fc47aaae84bab581a62f460a9bad40ccf758fcbda1b4f38091b323acb8fdd2aabd9725f96d8c373c2cf33a1204d72851400f1f087abd36f81f7f355848786c65
7
+ data.tar.gz: 41fcb0e2aee2ba8db3a379dee590ab99ba62788179908c30062893be05341ffa3cdf418bc3e480d701e49208a35a6d61cd7c2421511f223355847cb2a869cbc2
@@ -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)
@@ -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
- fail(Twitter::Error::ConfigurationError.new("Invalid #{credential} specified: #{value.inspect} must be a String."))
63
+ raise(Twitter::Error::ConfigurationError.new("Invalid #{credential} specified: #{value.inspect} must be a String."))
64
64
  end
65
65
  end
66
66
  end
@@ -19,12 +19,12 @@ module Twitter
19
19
  end
20
20
 
21
21
  def instance_of?(klass)
22
- fail(TypeError.new('class or module required')) unless klass.is_a?(Class)
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
- fail(TypeError.new('class or module required')) unless mod.is_a?(Module)
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
@@ -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
- fail(Twitter::Error::UnacceptableIO.new) unless media.respond_to?(:to_io)
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.each do |key, value|
16
- next unless value.respond_to?(:to_io)
17
- request.body[key] = Faraday::UploadIO.new(value, mime_type(value.path), value.path)
18
- end if request.body.is_a?(::Hash)
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
- fail(handle_forbidden_errors(response))
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
@@ -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
- fail(Twitter::Error::UnacceptableIO.new) unless media.respond_to?(:to_io)
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?
@@ -8,7 +8,7 @@ module Twitter
8
8
  ].freeze
9
9
 
10
10
  TWEET_EVENTS = [
11
- :favorite, :unfavorite
11
+ :favorite, :unfavorite, :quoted_tweet
12
12
  ].freeze
13
13
 
14
14
  attr_reader :name, :source, :target, :target_object
@@ -18,7 +18,7 @@ module Twitter
18
18
 
19
19
  def on_headers_complete(_headers)
20
20
  error = Twitter::Error.errors[@parser.status_code]
21
- fail error.new if error
21
+ raise error.new if error
22
22
  end
23
23
 
24
24
  def on_body(data)
@@ -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?
@@ -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
@@ -9,7 +9,7 @@ module Twitter
9
9
 
10
10
  # @return [Integer]
11
11
  def minor
12
- 16
12
+ 17
13
13
  end
14
14
 
15
15
  # @return [Integer]
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.16.0
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-01-24 00:00:00.000000000 Z
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.1
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: