twitter 7.0.0 → 8.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -4
  3. data/README.md +4 -6
  4. data/lib/twitter/base.rb +11 -11
  5. data/lib/twitter/basic_user.rb +3 -2
  6. data/lib/twitter/client.rb +3 -3
  7. data/lib/twitter/creatable.rb +2 -2
  8. data/lib/twitter/cursor.rb +3 -3
  9. data/lib/twitter/direct_message.rb +4 -5
  10. data/lib/twitter/direct_message_event.rb +3 -3
  11. data/lib/twitter/direct_messages/welcome_message.rb +3 -3
  12. data/lib/twitter/direct_messages/welcome_message_rule.rb +2 -2
  13. data/lib/twitter/direct_messages/welcome_message_rule_wrapper.rb +3 -3
  14. data/lib/twitter/direct_messages/welcome_message_wrapper.rb +3 -3
  15. data/lib/twitter/entities.rb +6 -6
  16. data/lib/twitter/entity/hashtag.rb +1 -1
  17. data/lib/twitter/entity/symbol.rb +1 -1
  18. data/lib/twitter/entity/uri.rb +1 -1
  19. data/lib/twitter/entity/user_mention.rb +1 -1
  20. data/lib/twitter/entity.rb +1 -1
  21. data/lib/twitter/enumerable.rb +1 -3
  22. data/lib/twitter/error.rb +7 -6
  23. data/lib/twitter/factory.rb +1 -1
  24. data/lib/twitter/geo/point.rb +1 -1
  25. data/lib/twitter/geo/polygon.rb +1 -1
  26. data/lib/twitter/geo.rb +2 -2
  27. data/lib/twitter/geo_factory.rb +3 -3
  28. data/lib/twitter/geo_results.rb +2 -2
  29. data/lib/twitter/headers.rb +4 -4
  30. data/lib/twitter/identity.rb +2 -2
  31. data/lib/twitter/language.rb +1 -1
  32. data/lib/twitter/list.rb +3 -2
  33. data/lib/twitter/media/animated_gif.rb +1 -1
  34. data/lib/twitter/media/photo.rb +2 -2
  35. data/lib/twitter/media/video.rb +3 -3
  36. data/lib/twitter/media/video_info.rb +2 -2
  37. data/lib/twitter/media_factory.rb +4 -4
  38. data/lib/twitter/metadata.rb +1 -1
  39. data/lib/twitter/null_object.rb +4 -4
  40. data/lib/twitter/oembed.rb +2 -1
  41. data/lib/twitter/place.rb +3 -3
  42. data/lib/twitter/premium_search_results.rb +5 -5
  43. data/lib/twitter/profile.rb +8 -8
  44. data/lib/twitter/profile_banner.rb +2 -2
  45. data/lib/twitter/rate_limit.rb +4 -4
  46. data/lib/twitter/relationship.rb +2 -1
  47. data/lib/twitter/rest/account_activity.rb +3 -3
  48. data/lib/twitter/rest/api.rb +19 -19
  49. data/lib/twitter/rest/client.rb +4 -4
  50. data/lib/twitter/rest/direct_messages/welcome_messages.rb +13 -13
  51. data/lib/twitter/rest/direct_messages.rb +17 -17
  52. data/lib/twitter/rest/favorites.rb +15 -19
  53. data/lib/twitter/rest/form_encoder.rb +27 -0
  54. data/lib/twitter/rest/friends_and_followers.rb +21 -21
  55. data/lib/twitter/rest/help.rb +6 -18
  56. data/lib/twitter/rest/lists.rb +32 -32
  57. data/lib/twitter/rest/oauth.rb +8 -8
  58. data/lib/twitter/rest/places_and_geo.rb +6 -6
  59. data/lib/twitter/rest/premium_search.rb +3 -3
  60. data/lib/twitter/rest/request.rb +28 -21
  61. data/lib/twitter/rest/saved_searches.rb +6 -6
  62. data/lib/twitter/rest/search.rb +3 -3
  63. data/lib/twitter/rest/spam_reporting.rb +3 -3
  64. data/lib/twitter/rest/suggested_users.rb +5 -5
  65. data/lib/twitter/rest/timelines.rb +7 -7
  66. data/lib/twitter/rest/trends.rb +7 -7
  67. data/lib/twitter/rest/tweets.rb +19 -23
  68. data/lib/twitter/rest/undocumented.rb +7 -7
  69. data/lib/twitter/rest/upload_utils.rb +13 -13
  70. data/lib/twitter/rest/users.rb +32 -32
  71. data/lib/twitter/rest/utils.rb +17 -17
  72. data/lib/twitter/saved_search.rb +2 -2
  73. data/lib/twitter/search_results.rb +6 -6
  74. data/lib/twitter/settings.rb +2 -1
  75. data/lib/twitter/size.rb +2 -2
  76. data/lib/twitter/source_user.rb +1 -1
  77. data/lib/twitter/streaming/client.rb +14 -14
  78. data/lib/twitter/streaming/connection.rb +4 -5
  79. data/lib/twitter/streaming/message_parser.rb +6 -6
  80. data/lib/twitter/streaming/response.rb +11 -10
  81. data/lib/twitter/suggestion.rb +3 -3
  82. data/lib/twitter/target_user.rb +1 -1
  83. data/lib/twitter/trend.rb +3 -2
  84. data/lib/twitter/trend_results.rb +5 -5
  85. data/lib/twitter/tweet.rb +3 -3
  86. data/lib/twitter/user.rb +9 -9
  87. data/lib/twitter/utils.rb +2 -2
  88. data/lib/twitter/variant.rb +2 -1
  89. data/lib/twitter/version.rb +3 -3
  90. data/lib/twitter.rb +36 -36
  91. data/twitter.gemspec +19 -18
  92. metadata +23 -22
  93. data/lib/twitter/configuration.rb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 578178613b24f694731c9b87c940488762c35a0f4027b57bbd518bd9f914469c
4
- data.tar.gz: 4ad56cc9e3c49d60cdc9f60777f37070cd6d933cd53bb2b2a9e82fe6f6f5f193
3
+ metadata.gz: b80e3506c8a84c489163c646cc9dee9796125556ac219c29f324f533436e2699
4
+ data.tar.gz: 25c98a022fefc26d3c38de160a4afa6edcf619e79b9f72487e61643891eb65fb
5
5
  SHA512:
6
- metadata.gz: e9e85b61e8f806fda08720a1b3290370bf1824bd5afba0f2afce2e3d29956dafaa60ae500299349863e320074d4c8944046dd98b065d7f9900c7eb4e896fa05f
7
- data.tar.gz: a10adbd38f44ba009ca21230a3a439f3b246bc84779aa9f80161643efb36e6abebeeb0d648257d1a29ccb1a65b06de445eac523aff36137e045cb40beae0246c
6
+ metadata.gz: bd410ed4a557fb3e2890e9fc6cd81672f73b1d8dfa4d0c5cb3f793943074f5ef8aba43332e833bc411ac39c1648a0835145a4c722f6c94bd790fcd7d390610c3
7
+ data.tar.gz: 726be9e6536df1c63fdbf528011ddffeeee5c88bf65031f88555009718626c40a7e8661356abd4c58be6709b289565a4e56fb36127a9512b4c7009d27b4bf26b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
+ 8.0.0
2
+ -----
3
+ * [Fix filter limit issue](https://github.com/sferik/twitter/commit/be91024f7af7e94dd6578e08937975443dc09487)
4
+ * [Pass custom `HTTP::FormData` with encoder for post requests](https://github.com/sferik/twitter/commit/62d15daf1f7009b532bced2423d2e3878c4a6628)
5
+ * [Removed the `Twitter::Configuration` class](https://github.com/sferik/twitter/commit/d9b49dbb60427e447b25afad5a4824a068b577c5)
6
+ * [Replace `http_parser.rb` with `llhttp`](https://github.com/sferik/twitter/commit/b30a831477910fa6b311c6de98fafabc5dccf827)
7
+ * [Update `buftok` dependency to ~> 0.3.0](https://github.com/sferik/twitter/commit/69237190197cae174cee09b4765230aadf231e3a)
8
+ * [Update `http` dependency to ~> 5.0](https://github.com/sferik/twitter/commit/d218358b9fdba501d0f4e59a10bd1e86f18e044f)
9
+ * [Set minimum required ruby version to 2.7.7](https://github.com/sferik/twitter/commit/3b50a1fe31233fbe85e5cf9d722aba13fa61aed8)
10
+
1
11
  7.0.0
2
- ------
12
+ -----
3
13
  * [Add `Twitter::DirectMessageEvent`](https://github.com/sferik/twitter/commit/38f6aaa482dcd5f4982abd811dbe6e21e36c2ae8) ([@FabienChaynes](https://twitter.com/FabienChaynes))
4
14
  * [Create `Twitter::DirectMessageEvent` with media](https://github.com/sferik/twitter/commit/21478530ec6f8a798717a5ab8b197b895db3bc28) ([@FabienChaynes](https://twitter.com/FabienChaynes))
5
15
  * [Support for DM welcome messages](https://github.com/sferik/twitter/pull/950) ([@FabienChaynes](https://twitter.com/FabienChaynes))
@@ -17,17 +27,17 @@
17
27
  * [Drop support for Ruby 2.0, 2.1, and 2.2](https://github.com/sferik/twitter/commit/95861ec83e582c2a88499b97d9d5388a96d0abf0)
18
28
 
19
29
  6.2.0
20
- ------
30
+ -----
21
31
  Not yet documented, sorry. For now, please use git to compare tags:
22
32
  https://github.com/sferik/twitter/compare/v6.1.0...v6.2.0
23
33
 
24
34
  6.1.0
25
- ------
35
+ -----
26
36
  Not yet documented, sorry. For now, please use git to compare tags:
27
37
  https://github.com/sferik/twitter/compare/v6.0.0...v6.1.0
28
38
 
29
39
  6.0.0
30
- ------
40
+ -----
31
41
  * [Drop support for Ruby 1.8.7 and Ruby 1.9.3](https://github.com/sferik/twitter/commit/27980f45fb357e34b86e46cb9134d86ed29b3ce3)
32
42
 
33
43
  5.16.0
data/README.md CHANGED
@@ -3,13 +3,11 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/twitter.svg)][gem]
4
4
  [![Build Status](https://travis-ci.org/sferik/twitter.svg?branch=master)][travis]
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/09362621ad91e8f599b3/maintainability)][maintainability]
6
- [![Coverage Status](https://coveralls.io/repos/github/sferik/twitter/badge.svg?branch=master)][coveralls]
7
6
  [![Inline docs](http://inch-ci.org/github/sferik/twitter.svg?style=shields)][inchpages]
8
7
 
9
8
  [gem]: https://rubygems.org/gems/twitter
10
9
  [travis]: https://travis-ci.org/sferik/twitter
11
10
  [maintainability]: https://codeclimate.com/github/sferik/twitter/maintainability
12
- [coveralls]: https://coveralls.io/r/sferik/twitter
13
11
  [inchpages]: http://inch-ci.org/github/sferik/twitter
14
12
 
15
13
  A Ruby interface to the Twitter API.
@@ -229,10 +227,10 @@ command:
229
227
  This library aims to support and is [tested against][travis] the following Ruby
230
228
  versions:
231
229
 
232
- * Ruby 2.4
233
- * Ruby 2.5
234
- * Ruby 2.6
235
230
  * Ruby 2.7
231
+ * Ruby 3.0
232
+ * Ruby 3.1
233
+ * Ruby 3.2
236
234
 
237
235
  If something doesn't work on one of these versions, it's a bug.
238
236
 
@@ -263,7 +261,7 @@ Constraint][pvc] with two digits of precision. For example:
263
261
  [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
264
262
 
265
263
  ## Copyright
266
- Copyright (c) 2006-2016 Erik Michaels-Ober, John Nunemaker, Wynn Netherland, Steve Richert, Steve Agalloco.
264
+ Copyright (c) 2006-2016 Erik Berlin, John Nunemaker, Wynn Netherland, Steve Richert, Steve Agalloco.
267
265
  See [LICENSE][] for details.
268
266
 
269
267
  [license]: LICENSE.md
data/lib/twitter/base.rb CHANGED
@@ -1,8 +1,8 @@
1
- require 'addressable/uri'
2
- require 'forwardable'
3
- require 'memoizable'
4
- require 'twitter/null_object'
5
- require 'twitter/utils'
1
+ require "addressable/uri"
2
+ require "forwardable"
3
+ require "memoizable"
4
+ require "twitter/null_object"
5
+ require "twitter/utils"
6
6
 
7
7
  module Twitter
8
8
  class Base
@@ -46,10 +46,10 @@ module Twitter
46
46
  # @param attrs [Array, Symbol]
47
47
  def uri_attr_reader(*attrs)
48
48
  attrs.each do |uri_key|
49
- array = uri_key.to_s.split('_')
50
- index = array.index('uri')
51
- array[index] = 'url'
52
- url_key = array.join('_').to_sym
49
+ array = uri_key.to_s.split("_")
50
+ index = array.index("uri")
51
+ array[index] = "url"
52
+ url_key = array.join("_").to_sym
53
53
  define_uri_method(uri_key, url_key)
54
54
  alias_method(url_key, uri_key)
55
55
  define_predicate_method(uri_key, url_key)
@@ -71,7 +71,7 @@ module Twitter
71
71
  # @param key2 [Symbol]
72
72
  def define_uri_method(key1, key2)
73
73
  define_method(key1) do
74
- Addressable::URI.parse(@attrs[key2].chomp('#')) unless @attrs[key2].nil?
74
+ Addressable::URI.parse(@attrs[key2].chomp("#")) unless @attrs[key2].nil?
75
75
  end
76
76
  memoize(key1)
77
77
  end
@@ -125,7 +125,7 @@ module Twitter
125
125
  private
126
126
 
127
127
  def attr_falsey_or_empty?(key)
128
- !@attrs[key] || @attrs[key].respond_to?(:empty?) && @attrs[key].empty?
128
+ !@attrs[key] || (@attrs[key].respond_to?(:empty?) && @attrs[key].empty?)
129
129
  end
130
130
 
131
131
  def attrs_for_object(key1, key2 = nil)
@@ -1,10 +1,11 @@
1
- require 'twitter/identity'
2
- require 'twitter/utils'
1
+ require "twitter/identity"
2
+ require "twitter/utils"
3
3
 
4
4
  module Twitter
5
5
  class BasicUser < Twitter::Identity
6
6
  # @return [String]
7
7
  attr_reader :screen_name
8
+
8
9
  predicate_attr_reader :following
9
10
  end
10
11
  end
@@ -1,6 +1,6 @@
1
- require 'twitter/error'
2
- require 'twitter/utils'
3
- require 'twitter/version'
1
+ require "twitter/error"
2
+ require "twitter/utils"
3
+ require "twitter/version"
4
4
 
5
5
  module Twitter
6
6
  class Client
@@ -1,5 +1,5 @@
1
- require 'time'
2
- require 'memoizable'
1
+ require "time"
2
+ require "memoizable"
3
3
 
4
4
  module Twitter
5
5
  module Creatable
@@ -1,6 +1,6 @@
1
- require 'twitter/enumerable'
2
- require 'twitter/rest/request'
3
- require 'twitter/utils'
1
+ require "twitter/enumerable"
2
+ require "twitter/rest/request"
3
+ require "twitter/utils"
4
4
 
5
5
  module Twitter
6
6
  class Cursor
@@ -1,6 +1,6 @@
1
- require 'twitter/creatable'
2
- require 'twitter/entities'
3
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/entities"
3
+ require "twitter/identity"
4
4
 
5
5
  module Twitter
6
6
  class DirectMessage < Twitter::Identity
@@ -8,8 +8,7 @@ module Twitter
8
8
  include Twitter::Entities
9
9
  # @return [String]
10
10
  attr_reader :text
11
- attr_reader :sender_id
12
- attr_reader :recipient_id
11
+ attr_reader :sender_id, :recipient_id
13
12
  alias full_text text
14
13
  object_attr_reader :User, :recipient
15
14
  object_attr_reader :User, :sender
@@ -1,6 +1,6 @@
1
- require 'twitter/creatable'
2
- require 'twitter/entities'
3
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/entities"
3
+ require "twitter/identity"
4
4
 
5
5
  module Twitter
6
6
  class DirectMessageEvent < Twitter::Identity
@@ -1,6 +1,6 @@
1
- require 'twitter/creatable'
2
- require 'twitter/entities'
3
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/entities"
3
+ require "twitter/identity"
4
4
 
5
5
  module Twitter
6
6
  module DirectMessages
@@ -1,5 +1,5 @@
1
- require 'twitter/creatable'
2
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/identity"
3
3
 
4
4
  module Twitter
5
5
  module DirectMessages
@@ -1,12 +1,12 @@
1
- require 'twitter/creatable'
2
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/identity"
3
3
 
4
4
  module Twitter
5
5
  module DirectMessages
6
6
  class WelcomeMessageRuleWrapper < Twitter::Identity
7
7
  attr_reader :created_timestamp
8
8
 
9
- object_attr_reader 'DirectMessages::WelcomeMessageRule', :welcome_message_rule
9
+ object_attr_reader "DirectMessages::WelcomeMessageRule", :welcome_message_rule
10
10
 
11
11
  def initialize(attrs)
12
12
  attrs = read_from_response(attrs)
@@ -1,12 +1,12 @@
1
- require 'twitter/creatable'
2
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/identity"
3
3
 
4
4
  module Twitter
5
5
  module DirectMessages
6
6
  class WelcomeMessageWrapper < Twitter::Identity
7
7
  attr_reader :created_timestamp
8
8
 
9
- object_attr_reader 'DirectMessages::WelcomeMessage', :welcome_message
9
+ object_attr_reader "DirectMessages::WelcomeMessage", :welcome_message
10
10
 
11
11
  def initialize(attrs)
12
12
  attrs = read_from_response(attrs)
@@ -1,9 +1,9 @@
1
- require 'memoizable'
2
- require 'twitter/entity/hashtag'
3
- require 'twitter/entity/symbol'
4
- require 'twitter/entity/uri'
5
- require 'twitter/entity/user_mention'
6
- require 'twitter/media_factory'
1
+ require "memoizable"
2
+ require "twitter/entity/hashtag"
3
+ require "twitter/entity/symbol"
4
+ require "twitter/entity/uri"
5
+ require "twitter/entity/user_mention"
6
+ require "twitter/media_factory"
7
7
 
8
8
  module Twitter
9
9
  module Entities
@@ -1,4 +1,4 @@
1
- require 'twitter/entity'
1
+ require "twitter/entity"
2
2
 
3
3
  module Twitter
4
4
  class Entity
@@ -1,4 +1,4 @@
1
- require 'twitter/entity'
1
+ require "twitter/entity"
2
2
 
3
3
  module Twitter
4
4
  class Entity
@@ -1,4 +1,4 @@
1
- require 'twitter/entity'
1
+ require "twitter/entity"
2
2
 
3
3
  module Twitter
4
4
  class Entity
@@ -1,4 +1,4 @@
1
- require 'twitter/entity'
1
+ require "twitter/entity"
2
2
 
3
3
  module Twitter
4
4
  class Entity
@@ -1,4 +1,4 @@
1
- require 'twitter/base'
1
+ require "twitter/base"
2
2
 
3
3
  module Twitter
4
4
  class Entity < Twitter::Base
@@ -6,9 +6,7 @@ module Twitter
6
6
  def each(start = 0, &block)
7
7
  return to_enum(:each, start) unless block_given?
8
8
 
9
- Array(@collection[start..-1]).each do |element|
10
- yield(element)
11
- end
9
+ Array(@collection[start..]).each(&block)
12
10
  unless finished?
13
11
  start = [@collection.size, start].max
14
12
  fetch_next_page
data/lib/twitter/error.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'twitter/rate_limit'
1
+ require "twitter/rate_limit"
2
2
 
3
3
  module Twitter
4
4
  # Custom error class for rescuing from all Twitter errors
@@ -81,6 +81,7 @@ module Twitter
81
81
  404 => Twitter::Error::NotFound,
82
82
  406 => Twitter::Error::NotAcceptable,
83
83
  413 => Twitter::Error::RequestEntityTooLarge,
84
+ 420 => Twitter::Error::TooManyRequests,
84
85
  422 => Twitter::Error::UnprocessableEntity,
85
86
  429 => Twitter::Error::TooManyRequests,
86
87
  500 => Twitter::Error::InternalServerError,
@@ -106,9 +107,9 @@ module Twitter
106
107
  end
107
108
 
108
109
  MEDIA_ERRORS = {
109
- 'InternalError' => Twitter::Error::MediaInternalError,
110
- 'InvalidMedia' => Twitter::Error::InvalidMedia,
111
- 'UnsupportedMedia' => Twitter::Error::UnsupportedMedia,
110
+ "InternalError" => Twitter::Error::MediaInternalError,
111
+ "InvalidMedia" => Twitter::Error::InvalidMedia,
112
+ "UnsupportedMedia" => Twitter::Error::UnsupportedMedia,
112
113
  }.freeze
113
114
 
114
115
  # If error code is missing see https://developer.twitter.com/en/docs/basics/response-codes
@@ -168,7 +169,7 @@ module Twitter
168
169
 
169
170
  def parse_error(body)
170
171
  if body.nil? || body.empty?
171
- ['', nil]
172
+ ["", nil]
172
173
  elsif body[:error]
173
174
  [body[:error], nil]
174
175
  elsif body[:errors]
@@ -192,7 +193,7 @@ module Twitter
192
193
  # @param rate_limit [Hash]
193
194
  # @param code [Integer]
194
195
  # @return [Twitter::Error]
195
- def initialize(message = '', rate_limit = {}, code = nil)
196
+ def initialize(message = "", rate_limit = {}, code = nil)
196
197
  super(message)
197
198
  @rate_limit = Twitter::RateLimit.new(rate_limit)
198
199
  @code = code
@@ -10,7 +10,7 @@ module Twitter
10
10
  # @return [Twitter::Base]
11
11
  def new(method, klass, attrs = {})
12
12
  type = attrs.fetch(method.to_sym)
13
- const_name = type.split('_').collect(&:capitalize).join
13
+ const_name = type.split("_").collect(&:capitalize).join
14
14
  klass.const_get(const_name.to_sym).new(attrs)
15
15
  end
16
16
  end
@@ -1,4 +1,4 @@
1
- require 'twitter/geo'
1
+ require "twitter/geo"
2
2
 
3
3
  module Twitter
4
4
  class Geo
@@ -1,4 +1,4 @@
1
- require 'twitter/geo'
1
+ require "twitter/geo"
2
2
 
3
3
  module Twitter
4
4
  class Geo
data/lib/twitter/geo.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'equalizer'
2
- require 'twitter/base'
1
+ require "equalizer"
2
+ require "twitter/base"
3
3
 
4
4
  module Twitter
5
5
  class Geo < Twitter::Base
@@ -1,6 +1,6 @@
1
- require 'twitter/factory'
2
- require 'twitter/geo/point'
3
- require 'twitter/geo/polygon'
1
+ require "twitter/factory"
2
+ require "twitter/geo/point"
3
+ require "twitter/geo/polygon"
4
4
 
5
5
  module Twitter
6
6
  class GeoFactory < Twitter::Factory
@@ -1,5 +1,5 @@
1
- require 'twitter/enumerable'
2
- require 'twitter/utils'
1
+ require "twitter/enumerable"
2
+ require "twitter/utils"
3
3
 
4
4
  module Twitter
5
5
  class GeoResults
@@ -1,6 +1,6 @@
1
- require 'addressable/uri'
2
- require 'base64'
3
- require 'simple_oauth'
1
+ require "addressable/uri"
2
+ require "base64"
3
+ require "simple_oauth"
4
4
 
5
5
  module Twitter
6
6
  class Headers
@@ -24,7 +24,7 @@ module Twitter
24
24
  headers = {}
25
25
  headers[:user_agent] = @client.user_agent
26
26
  if bearer_token_request?
27
- headers[:accept] = '*/*'
27
+ headers[:accept] = "*/*"
28
28
  headers[:authorization] = bearer_token_credentials_auth_header
29
29
  else
30
30
  headers[:authorization] = auth_header
@@ -1,5 +1,5 @@
1
- require 'equalizer'
2
- require 'twitter/base'
1
+ require "equalizer"
2
+ require "twitter/base"
3
3
 
4
4
  module Twitter
5
5
  class Identity < Twitter::Base
@@ -1,4 +1,4 @@
1
- require 'twitter/base'
1
+ require "twitter/base"
2
2
 
3
3
  module Twitter
4
4
  class Language < Twitter::Base
data/lib/twitter/list.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'twitter/creatable'
2
- require 'twitter/identity'
1
+ require "twitter/creatable"
2
+ require "twitter/identity"
3
3
 
4
4
  module Twitter
5
5
  class List < Twitter::Identity
@@ -8,6 +8,7 @@ module Twitter
8
8
  attr_reader :member_count, :subscriber_count
9
9
  # @return [String]
10
10
  attr_reader :description, :full_name, :mode, :name, :slug
11
+
11
12
  object_attr_reader :User, :user
12
13
  predicate_attr_reader :following
13
14
 
@@ -1,4 +1,4 @@
1
- require 'twitter/media/video'
1
+ require "twitter/media/video"
2
2
 
3
3
  module Twitter
4
4
  module Media
@@ -1,5 +1,5 @@
1
- require 'memoizable'
2
- require 'twitter/identity'
1
+ require "memoizable"
2
+ require "twitter/identity"
3
3
 
4
4
  module Twitter
5
5
  module Media
@@ -1,6 +1,6 @@
1
- require 'memoizable'
2
- require 'twitter/identity'
3
- require 'twitter/media/video_info'
1
+ require "memoizable"
2
+ require "twitter/identity"
3
+ require "twitter/media/video_info"
4
4
 
5
5
  module Twitter
6
6
  module Media
@@ -1,5 +1,5 @@
1
- require 'memoizable'
2
- require 'twitter/variant'
1
+ require "memoizable"
2
+ require "twitter/variant"
3
3
 
4
4
  module Twitter
5
5
  module Media
@@ -1,7 +1,7 @@
1
- require 'twitter/factory'
2
- require 'twitter/media/animated_gif'
3
- require 'twitter/media/photo'
4
- require 'twitter/media/video'
1
+ require "twitter/factory"
2
+ require "twitter/media/animated_gif"
3
+ require "twitter/media/photo"
4
+ require "twitter/media/video"
5
5
 
6
6
  module Twitter
7
7
  class MediaFactory < Twitter::Factory
@@ -1,4 +1,4 @@
1
- require 'twitter/base'
1
+ require "twitter/base"
2
2
 
3
3
  module Twitter
4
4
  class Metadata < Twitter::Base
@@ -1,4 +1,4 @@
1
- require 'naught'
1
+ require "naught"
2
2
 
3
3
  module Twitter
4
4
  NullObject = Naught.build do |config| # rubocop:disable Metrics/BlockLength
@@ -18,13 +18,13 @@ module Twitter
18
18
  end
19
19
 
20
20
  def instance_of?(klass)
21
- raise(TypeError, 'class or module required') unless klass.is_a?(Class)
21
+ raise(TypeError, "class or module required") unless klass.is_a?(Class)
22
22
 
23
23
  self.class == klass
24
24
  end
25
25
 
26
26
  def kind_of?(mod)
27
- raise(TypeError, 'class or module required') unless mod.is_a?(Module)
27
+ raise(TypeError, "class or module required") unless mod.is_a?(Module)
28
28
 
29
29
  self.class.ancestors.include?(mod)
30
30
  end
@@ -44,7 +44,7 @@ module Twitter
44
44
  end
45
45
 
46
46
  def as_json(*)
47
- 'null'
47
+ "null"
48
48
  end
49
49
 
50
50
  def to_json(*args)
@@ -1,4 +1,4 @@
1
- require 'twitter/base'
1
+ require "twitter/base"
2
2
 
3
3
  module Twitter
4
4
  class OEmbed < Twitter::Base
@@ -7,6 +7,7 @@ module Twitter
7
7
  # @return [String]
8
8
  attr_reader :author_name, :cache_age, :html, :provider_name, :type,
9
9
  :version
10
+
10
11
  uri_attr_reader :author_uri, :provider_uri, :uri
11
12
  end
12
13
  end
data/lib/twitter/place.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'memoizable'
2
- require 'twitter/identity'
1
+ require "memoizable"
2
+ require "twitter/identity"
3
3
 
4
4
  module Twitter
5
5
  class Place < Twitter::Identity
@@ -40,7 +40,7 @@ module Twitter
40
40
 
41
41
  # @return [String]
42
42
  def place_type
43
- @attrs[:place_type] || @attrs[:placeType] && @attrs[:placeType][:name]
43
+ @attrs[:place_type] || (@attrs[:placeType] && @attrs[:placeType][:name])
44
44
  end
45
45
  memoize :place_type
46
46
  end
@@ -1,8 +1,8 @@
1
- require 'cgi'
2
- require 'twitter/enumerable'
3
- require 'twitter/rest/request'
4
- require 'twitter/utils'
5
- require 'uri'
1
+ require "cgi"
2
+ require "twitter/enumerable"
3
+ require "twitter/rest/request"
4
+ require "twitter/utils"
5
+ require "uri"
6
6
 
7
7
  module Twitter
8
8
  class PremiumSearchResults