twitter 5.14.0 → 5.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -7
  2. data/CHANGELOG.md +8 -0
  3. data/LICENSE.md +1 -1
  4. data/README.md +10 -9
  5. data/lib/twitter/configuration.rb +3 -0
  6. data/lib/twitter/entity/uri.rb +2 -2
  7. data/lib/twitter/error.rb +9 -5
  8. data/lib/twitter/factory.rb +1 -1
  9. data/lib/twitter/headers.rb +1 -1
  10. data/lib/twitter/media/photo.rb +3 -0
  11. data/lib/twitter/media/video.rb +3 -0
  12. data/lib/twitter/media/video_info.rb +3 -0
  13. data/lib/twitter/null_object.rb +4 -0
  14. data/lib/twitter/place.rb +5 -3
  15. data/lib/twitter/profile_banner.rb +3 -0
  16. data/lib/twitter/rate_limit.rb +4 -0
  17. data/lib/twitter/rest/direct_messages.rb +8 -8
  18. data/lib/twitter/rest/favorites.rb +4 -4
  19. data/lib/twitter/rest/friends_and_followers.rb +14 -14
  20. data/lib/twitter/rest/help.rb +4 -4
  21. data/lib/twitter/rest/lists.rb +19 -19
  22. data/lib/twitter/rest/media.rb +1 -1
  23. data/lib/twitter/rest/oauth.rb +3 -3
  24. data/lib/twitter/rest/places_and_geo.rb +4 -4
  25. data/lib/twitter/rest/request/multipart_with_file.rb +6 -0
  26. data/lib/twitter/rest/saved_searches.rb +6 -6
  27. data/lib/twitter/rest/search.rb +2 -2
  28. data/lib/twitter/rest/spam_reporting.rb +1 -1
  29. data/lib/twitter/rest/suggested_users.rb +3 -3
  30. data/lib/twitter/rest/timelines.rb +7 -7
  31. data/lib/twitter/rest/trends.rb +3 -3
  32. data/lib/twitter/rest/tweets.rb +22 -20
  33. data/lib/twitter/rest/users.rb +27 -27
  34. data/lib/twitter/rest/utils.rb +4 -4
  35. data/lib/twitter/streaming/client.rb +20 -19
  36. data/lib/twitter/streaming/connection.rb +1 -1
  37. data/lib/twitter/streaming/deleted_tweet.rb +1 -1
  38. data/lib/twitter/suggestion.rb +3 -0
  39. data/lib/twitter/token.rb +3 -0
  40. data/lib/twitter/tweet.rb +5 -1
  41. data/lib/twitter/utils.rb +1 -1
  42. data/lib/twitter/version.rb +41 -11
  43. data/twitter.gemspec +2 -2
  44. metadata +102 -137
  45. data/lib/twitter/value.rb +0 -40
@@ -18,7 +18,7 @@ module Twitter
18
18
 
19
19
  ssl_client.connect
20
20
  request.stream(ssl_client)
21
- while body = ssl_client.readpartial(1024) # rubocop:disable AssignmentInCondition, WhileUntilModifier
21
+ while body = ssl_client.readpartial(1024) # rubocop:disable AssignmentInCondition
22
22
  response << body
23
23
  end
24
24
  end
@@ -4,6 +4,6 @@ module Twitter
4
4
  # @return [Integer]
5
5
  attr_reader :user_id
6
6
  end
7
- DeletedStatus = DeletedTweet # rubocop:disable ConstantName
7
+ DeletedStatus = DeletedTweet
8
8
  end
9
9
  end
@@ -1,9 +1,12 @@
1
1
  require 'equalizer'
2
+ require 'memoizable'
2
3
  require 'twitter/base'
3
4
 
4
5
  module Twitter
5
6
  class Suggestion < Twitter::Base
6
7
  include Equalizer.new(:slug)
8
+ include Memoizable
9
+
7
10
  # @return [Integer]
8
11
  attr_reader :size
9
12
  # @return [String]
@@ -1,7 +1,10 @@
1
+ require 'memoizable'
1
2
  require 'twitter/base'
2
3
 
3
4
  module Twitter
4
5
  class Token < Twitter::Base
6
+ include Memoizable
7
+
5
8
  # @return [String]
6
9
  attr_reader :access_token, :token_type
7
10
  alias_method :to_s, :access_token
@@ -20,9 +20,13 @@ module Twitter
20
20
  object_attr_reader :Metadata, :metadata
21
21
  object_attr_reader :Place, :place
22
22
  object_attr_reader :Tweet, :retweeted_status
23
+ object_attr_reader :Tweet, :quoted_status
23
24
  alias_method :retweeted_tweet, :retweeted_status
24
25
  alias_method :retweet?, :retweeted_status?
25
26
  alias_method :retweeted_tweet?, :retweeted_status?
27
+ alias_method :quoted_tweet, :quoted_status
28
+ alias_method :quote?, :quoted_status?
29
+ alias_method :quoted_tweet?, :quoted_status?
26
30
  object_attr_reader :User, :user, :status
27
31
  predicate_attr_reader :favorited, :possibly_sensitive, :retweeted,
28
32
  :truncated
@@ -46,5 +50,5 @@ module Twitter
46
50
  memoize :uri
47
51
  alias_method :url, :uri
48
52
  end
49
- Status = Tweet # rubocop:disable ConstantName
53
+ Status = Tweet
50
54
  end
@@ -22,7 +22,7 @@ module Twitter
22
22
  # @return [Array, Enumerator]
23
23
  def flat_pmap(enumerable)
24
24
  return to_enum(:flat_pmap, enumerable) unless block_given?
25
- pmap(enumerable, &Proc.new).flatten!(1)
25
+ pmap(enumerable, &Proc.new).flatten(1)
26
26
  end
27
27
  module_function :flat_pmap
28
28
 
@@ -1,15 +1,45 @@
1
1
  module Twitter
2
- class Version
3
- MAJOR = 5
4
- MINOR = 14
5
- PATCH = 0
6
- PRE = nil
7
-
8
- class << self
9
- # @return [String]
10
- def to_s
11
- [MAJOR, MINOR, PATCH, PRE].compact.join('.')
12
- end
2
+ module Version
3
+ module_function
4
+
5
+ # @return [Integer]
6
+ def major
7
+ 5
8
+ end
9
+
10
+ # @return [Integer]
11
+ def minor
12
+ 15
13
+ end
14
+
15
+ # @return [Integer]
16
+ def patch
17
+ 0
18
+ end
19
+
20
+ # @return [Integer, NilClass]
21
+ def pre
22
+ nil
23
+ end
24
+
25
+ # @return [Hash]
26
+ def to_h
27
+ {
28
+ :major => major,
29
+ :minor => minor,
30
+ :patch => patch,
31
+ :pre => pre,
32
+ }
33
+ end
34
+
35
+ # @return [Array]
36
+ def to_a
37
+ to_h.values.compact
38
+ end
39
+
40
+ # @return [String]
41
+ def to_s
42
+ to_a.join('.')
13
43
  end
14
44
  end
15
45
  end
@@ -5,9 +5,9 @@ require 'twitter/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.add_dependency 'addressable', '~> 2.3'
7
7
  spec.add_dependency 'buftok', '~> 0.2.0'
8
- spec.add_dependency 'equalizer', '~> 0.0.9'
8
+ spec.add_dependency 'equalizer', '0.0.10'
9
9
  spec.add_dependency 'faraday', '~> 0.9.0'
10
- spec.add_dependency 'http', '~> 0.6.0'
10
+ spec.add_dependency 'http', ['>= 0.4', '< 0.10']
11
11
  spec.add_dependency 'http_parser.rb', '~> 0.6.0'
12
12
  spec.add_dependency 'json', '~> 1.8'
13
13
  spec.add_dependency 'memoizable', '~> 0.4.0'
metadata CHANGED
@@ -1,9 +1,9 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: twitter
3
- version: !ruby/object:Gem::Version
4
- version: 5.14.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 5.15.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Erik Michaels-Ober
8
8
  - John Nunemaker
9
9
  - Wynn Netherland
@@ -12,170 +12,132 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-02-14 00:00:00.000000000 Z
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
15
+
16
+ date: 2015-09-06 00:00:00 Z
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
19
+ prerelease: false
18
20
  name: addressable
19
- requirement: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - "~>"
22
- - !ruby/object:Gem::Version
23
- version: '2.3'
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ~>
24
+ - !ruby/object:Gem::Version
25
+ version: "2.3"
24
26
  type: :runtime
27
+ requirement: *id001
28
+ - !ruby/object:Gem::Dependency
25
29
  prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- requirements:
28
- - - "~>"
29
- - !ruby/object:Gem::Version
30
- version: '2.3'
31
- - !ruby/object:Gem::Dependency
32
30
  name: buftok
33
- requirement: !ruby/object:Gem::Requirement
34
- requirements:
35
- - - "~>"
36
- - !ruby/object:Gem::Version
31
+ version_requirements: &id002 !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ~>
34
+ - !ruby/object:Gem::Version
37
35
  version: 0.2.0
38
36
  type: :runtime
37
+ requirement: *id002
38
+ - !ruby/object:Gem::Dependency
39
39
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - "~>"
43
- - !ruby/object:Gem::Version
44
- version: 0.2.0
45
- - !ruby/object:Gem::Dependency
46
40
  name: equalizer
47
- requirement: !ruby/object:Gem::Requirement
48
- requirements:
49
- - - "~>"
50
- - !ruby/object:Gem::Version
51
- version: 0.0.9
41
+ version_requirements: &id003 !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - "="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.0.10
52
46
  type: :runtime
47
+ requirement: *id003
48
+ - !ruby/object:Gem::Dependency
53
49
  prerelease: false
54
- version_requirements: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - "~>"
57
- - !ruby/object:Gem::Version
58
- version: 0.0.9
59
- - !ruby/object:Gem::Dependency
60
50
  name: faraday
61
- requirement: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - "~>"
64
- - !ruby/object:Gem::Version
51
+ version_requirements: &id004 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
65
55
  version: 0.9.0
66
56
  type: :runtime
57
+ requirement: *id004
58
+ - !ruby/object:Gem::Dependency
67
59
  prerelease: false
68
- version_requirements: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - "~>"
71
- - !ruby/object:Gem::Version
72
- version: 0.9.0
73
- - !ruby/object:Gem::Dependency
74
60
  name: http
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: 0.6.0
61
+ version_requirements: &id005 !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0.4"
66
+ - - <
67
+ - !ruby/object:Gem::Version
68
+ version: "0.10"
80
69
  type: :runtime
70
+ requirement: *id005
71
+ - !ruby/object:Gem::Dependency
81
72
  prerelease: false
82
- version_requirements: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - "~>"
85
- - !ruby/object:Gem::Version
86
- version: 0.6.0
87
- - !ruby/object:Gem::Dependency
88
73
  name: http_parser.rb
89
- requirement: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - "~>"
92
- - !ruby/object:Gem::Version
74
+ version_requirements: &id006 !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
93
78
  version: 0.6.0
94
79
  type: :runtime
80
+ requirement: *id006
81
+ - !ruby/object:Gem::Dependency
95
82
  prerelease: false
96
- version_requirements: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - "~>"
99
- - !ruby/object:Gem::Version
100
- version: 0.6.0
101
- - !ruby/object:Gem::Dependency
102
83
  name: json
103
- requirement: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - "~>"
106
- - !ruby/object:Gem::Version
107
- version: '1.8'
84
+ version_requirements: &id007 !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: "1.8"
108
89
  type: :runtime
90
+ requirement: *id007
91
+ - !ruby/object:Gem::Dependency
109
92
  prerelease: false
110
- version_requirements: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - "~>"
113
- - !ruby/object:Gem::Version
114
- version: '1.8'
115
- - !ruby/object:Gem::Dependency
116
93
  name: memoizable
117
- requirement: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - "~>"
120
- - !ruby/object:Gem::Version
94
+ version_requirements: &id008 !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ~>
97
+ - !ruby/object:Gem::Version
121
98
  version: 0.4.0
122
99
  type: :runtime
100
+ requirement: *id008
101
+ - !ruby/object:Gem::Dependency
123
102
  prerelease: false
124
- version_requirements: !ruby/object:Gem::Requirement
125
- requirements:
126
- - - "~>"
127
- - !ruby/object:Gem::Version
128
- version: 0.4.0
129
- - !ruby/object:Gem::Dependency
130
103
  name: naught
131
- requirement: !ruby/object:Gem::Requirement
132
- requirements:
133
- - - "~>"
134
- - !ruby/object:Gem::Version
135
- version: '1.0'
104
+ version_requirements: &id009 !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ~>
107
+ - &id011 !ruby/object:Gem::Version
108
+ version: "1.0"
136
109
  type: :runtime
110
+ requirement: *id009
111
+ - !ruby/object:Gem::Dependency
137
112
  prerelease: false
138
- version_requirements: !ruby/object:Gem::Requirement
139
- requirements:
140
- - - "~>"
141
- - !ruby/object:Gem::Version
142
- version: '1.0'
143
- - !ruby/object:Gem::Dependency
144
113
  name: simple_oauth
145
- requirement: !ruby/object:Gem::Requirement
146
- requirements:
147
- - - "~>"
148
- - !ruby/object:Gem::Version
114
+ version_requirements: &id010 !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ~>
117
+ - !ruby/object:Gem::Version
149
118
  version: 0.3.0
150
119
  type: :runtime
120
+ requirement: *id010
121
+ - !ruby/object:Gem::Dependency
151
122
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- requirements:
154
- - - "~>"
155
- - !ruby/object:Gem::Version
156
- version: 0.3.0
157
- - !ruby/object:Gem::Dependency
158
123
  name: bundler
159
- requirement: !ruby/object:Gem::Requirement
160
- requirements:
161
- - - "~>"
162
- - !ruby/object:Gem::Version
163
- version: '1.0'
124
+ version_requirements: &id012 !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ~>
127
+ - *id011
164
128
  type: :development
165
- prerelease: false
166
- version_requirements: !ruby/object:Gem::Requirement
167
- requirements:
168
- - - "~>"
169
- - !ruby/object:Gem::Version
170
- version: '1.0'
129
+ requirement: *id012
171
130
  description: A Ruby interface to the Twitter API.
172
- email:
131
+ email:
173
132
  - sferik@gmail.com
174
133
  executables: []
134
+
175
135
  extensions: []
136
+
176
137
  extra_rdoc_files: []
177
- files:
178
- - ".yardopts"
138
+
139
+ files:
140
+ - .yardopts
179
141
  - CHANGELOG.md
180
142
  - CONTRIBUTING.md
181
143
  - LICENSE.md
@@ -266,33 +228,36 @@ files:
266
228
  - lib/twitter/tweet.rb
267
229
  - lib/twitter/user.rb
268
230
  - lib/twitter/utils.rb
269
- - lib/twitter/value.rb
270
231
  - lib/twitter/variant.rb
271
232
  - lib/twitter/version.rb
272
233
  - twitter.gemspec
273
234
  homepage: http://sferik.github.com/twitter/
274
- licenses:
235
+ licenses:
275
236
  - MIT
276
237
  metadata: {}
238
+
277
239
  post_install_message:
278
240
  rdoc_options: []
279
- require_paths:
241
+
242
+ require_paths:
280
243
  - lib
281
- required_ruby_version: !ruby/object:Gem::Requirement
282
- requirements:
244
+ required_ruby_version: !ruby/object:Gem::Requirement
245
+ requirements:
283
246
  - - ">="
284
- - !ruby/object:Gem::Version
285
- version: '0'
286
- required_rubygems_version: !ruby/object:Gem::Requirement
287
- requirements:
247
+ - !ruby/object:Gem::Version
248
+ version: "0"
249
+ required_rubygems_version: !ruby/object:Gem::Requirement
250
+ requirements:
288
251
  - - ">="
289
- - !ruby/object:Gem::Version
252
+ - !ruby/object:Gem::Version
290
253
  version: 1.3.5
291
254
  requirements: []
255
+
292
256
  rubyforge_project:
293
- rubygems_version: 2.4.5
257
+ rubygems_version: 2.4.8
294
258
  signing_key:
295
259
  specification_version: 4
296
260
  summary: A Ruby interface to the Twitter API.
297
261
  test_files: []
262
+
298
263
  has_rdoc: