t 2.10.0 → 3.0.0

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
  SHA1:
3
- metadata.gz: a26d91bbbf1248998297b1ca780c2b60c18749cc
4
- data.tar.gz: b525d7aebabfa57f79f05af951d3eca545daee8c
3
+ metadata.gz: dffb68d3ffef0b5d653209a7425f779dfb0f7f64
4
+ data.tar.gz: c5d04c93f764afdb52ad1677eade5ea03bd4a419
5
5
  SHA512:
6
- metadata.gz: f7ccdf367adc9c47042a52f822e6f7b5f12d22fb4dffece434f70cc1d968d6d842dffcab8fe5807e0288cb7310aa54840fa3037978c067ba158d0fe4375960e4
7
- data.tar.gz: 6d4fd9b61299729e4bbfc2889ae3cd6817b17c0588f86f8b091abd633e058abedf1aaf68ae2dcb57285d8f06217eef71a748423da8dc9b89dfcde28224bf8af0
6
+ metadata.gz: c738537629fa02755015171b36d9739f6a0ec76ffe0099d2cd9da8bd1b1cc3610d431940e0f166c945f2966ea9b290d4af25e9f610c9ecd82648bf637e909453
7
+ data.tar.gz: aa99c2748440cbffd11e680bdfb8b6d7f1d3351e4bba0b5a0d0d9e253432ea286cd0c677af0e2379055b961687b342b375ea61d4651a5b4f659dc347203df0a7
data/README.md CHANGED
@@ -28,7 +28,7 @@ First, make sure you have Ruby installed.
28
28
 
29
29
  If the output looks something like this, you're in good shape:
30
30
 
31
- ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin13.0.0]
31
+ ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
32
32
 
33
33
  If the output looks more like this, you need to [install Ruby][ruby]:
34
34
  [ruby]: https://www.ruby-lang.org/en/downloads/
@@ -197,10 +197,11 @@ example, here's how to send a user a direct message only if they already follow
197
197
  #### Search Tweets you've retweeted that match a specified query
198
198
  t search retweets "query"
199
199
 
200
- #### Search Tweets in your timeline that match a specified query
200
+ #### Search Tweets in your home timeline that match a specified query
201
201
  t search timeline "query"
202
+ **Note**: In Twitter API parlance, your “home timeline” is your “Newsfeed” whereas your “user timeline” are the tweets tweeted (and retweeted) by you.
202
203
 
203
- #### Search Tweets in another user's timeline that match a specified query
204
+ #### Search Tweets in a specified users timeline
204
205
  t search timeline @sferik "query"
205
206
 
206
207
  ## Features
@@ -287,10 +288,10 @@ the original code.
287
288
  This library aims to support and is [tested against][travis] the following Ruby
288
289
  implementations:
289
290
 
290
- * Ruby 1.9.3
291
291
  * Ruby 2.0.0
292
292
  * Ruby 2.1
293
293
  * Ruby 2.2
294
+ * Ruby 2.3
294
295
 
295
296
  If something doesn't work on one of these Ruby versions, it's a bug.
296
297
 
@@ -778,7 +778,7 @@ module T
778
778
  end
779
779
  map %w(tl) => :timeline
780
780
 
781
- desc 'trends [WOEID]', 'Returns the top 10 trending topics.'
781
+ desc 'trends [WOEID]', 'Returns the top 50 trending topics.'
782
782
  method_option 'exclude-hashtags', aliases: '-x', type: :boolean, desc: 'Remove all hashtags from the trends list.'
783
783
  def trends(woe_id = 1)
784
784
  opts = {}
@@ -796,18 +796,20 @@ module T
796
796
  method_option 'unsorted', aliases: '-u', type: :boolean, desc: 'Output is not sorted.'
797
797
  def trend_locations
798
798
  places = client.trend_locations
799
- places = case options['sort']
800
- when 'country'
801
- places.sort_by { |place| place.country.downcase }
802
- when 'parent'
803
- places.sort_by { |place| place.parent_id.to_i }
804
- when 'type'
805
- places.sort_by { |place| place.place_type.downcase }
806
- when 'woeid'
807
- places.sort_by { |place| place.woeid.to_i }
808
- else
809
- places.sort_by { |place| place.name.downcase }
810
- end unless options['unsorted']
799
+ unless options['unsorted']
800
+ places = case options['sort']
801
+ when 'country'
802
+ places.sort_by { |place| place.country.downcase }
803
+ when 'parent'
804
+ places.sort_by { |place| place.parent_id.to_i }
805
+ when 'type'
806
+ places.sort_by { |place| place.place_type.downcase }
807
+ when 'woeid'
808
+ places.sort_by { |place| place.woeid.to_i }
809
+ else
810
+ places.sort_by { |place| place.name.downcase }
811
+ end
812
+ end
811
813
  places.reverse! if options['reverse']
812
814
  if options['csv']
813
815
  require 'csv'
@@ -30,7 +30,7 @@ module T
30
30
  end
31
31
 
32
32
  def bg(bit)
33
- bit == 0 ? "\033[48;5;#{@bcolor}m" : "\033[48;5;#{@fcolor}m"
33
+ bit.zero? ? "\033[48;5;#{@bcolor}m" : "\033[48;5;#{@fcolor}m"
34
34
  end
35
35
  end
36
36
 
@@ -43,7 +43,7 @@ module T
43
43
 
44
44
  def digest(string)
45
45
  require 'digest'
46
- Digest::MD5.digest(string).chars.inject(0) { |a, e| (a << 8) | e.ord }
46
+ Digest::MD5.digest(string).chars.inject(0) { |acc, elem| (acc << 8) | elem.ord }
47
47
  end
48
48
  end
49
49
  end
@@ -53,18 +53,20 @@ module T
53
53
  end
54
54
 
55
55
  def print_lists(lists)
56
- lists = case options['sort']
57
- when 'members'
58
- lists.sort_by(&:member_count)
59
- when 'mode'
60
- lists.sort_by(&:mode)
61
- when 'since'
62
- lists.sort_by(&:created_at)
63
- when 'subscribers'
64
- lists.sort_by(&:subscriber_count)
65
- else
66
- lists.sort_by { |list| list.slug.downcase }
67
- end unless options['unsorted']
56
+ unless options['unsorted']
57
+ lists = case options['sort']
58
+ when 'members'
59
+ lists.sort_by(&:member_count)
60
+ when 'mode'
61
+ lists.sort_by(&:mode)
62
+ when 'since'
63
+ lists.sort_by(&:created_at)
64
+ when 'subscribers'
65
+ lists.sort_by(&:subscriber_count)
66
+ else
67
+ lists.sort_by { |list| list.slug.downcase }
68
+ end
69
+ end
68
70
  lists.reverse! if options['reverse']
69
71
  if options['csv']
70
72
  require 'csv'
@@ -136,7 +138,7 @@ module T
136
138
  # Save 6 chars for icon, ensure at least 3 lines long
137
139
  lines = wrapped(HTMLEntities.new.decode(message), indent: 2, width: terminal_width - (6 + 5))
138
140
  lines.unshift(set_color(" @#{from_user}", :bold, :yellow))
139
- lines.push(*Array.new([3 - lines.length, 0].max) { '' })
141
+ lines.concat(Array.new([3 - lines.length, 0].max) { '' })
140
142
 
141
143
  $stdout.puts lines.zip(icon.lines).map { |x, i| " #{i || ' '}#{x}" }
142
144
  end
@@ -181,24 +183,26 @@ module T
181
183
  end
182
184
 
183
185
  def print_users(users) # rubocop:disable CyclomaticComplexity
184
- users = case options['sort']
185
- when 'favorites'
186
- users.sort_by { |user| user.favorites_count.to_i }
187
- when 'followers'
188
- users.sort_by { |user| user.followers_count.to_i }
189
- when 'friends'
190
- users.sort_by { |user| user.friends_count.to_i }
191
- when 'listed'
192
- users.sort_by { |user| user.listed_count.to_i }
193
- when 'since'
194
- users.sort_by(&:created_at)
195
- when 'tweets'
196
- users.sort_by { |user| user.statuses_count.to_i }
197
- when 'tweeted'
198
- users.sort_by { |user| user.status? ? user.status.created_at : Time.at(0) } # rubocop:disable BlockNesting
199
- else
200
- users.sort_by { |user| user.screen_name.downcase }
201
- end unless options['unsorted']
186
+ unless options['unsorted']
187
+ users = case options['sort']
188
+ when 'favorites'
189
+ users.sort_by { |user| user.favorites_count.to_i }
190
+ when 'followers'
191
+ users.sort_by { |user| user.followers_count.to_i }
192
+ when 'friends'
193
+ users.sort_by { |user| user.friends_count.to_i }
194
+ when 'listed'
195
+ users.sort_by { |user| user.listed_count.to_i }
196
+ when 'since'
197
+ users.sort_by(&:created_at)
198
+ when 'tweets'
199
+ users.sort_by { |user| user.statuses_count.to_i }
200
+ when 'tweeted'
201
+ users.sort_by { |user| user.status? ? user.status.created_at : Time.at(0) } # rubocop:disable BlockNesting
202
+ else
203
+ users.sort_by { |user| user.screen_name.downcase }
204
+ end
205
+ end
202
206
  users.reverse! if options['reverse']
203
207
  if options['csv']
204
208
  require 'csv'
@@ -17,11 +17,8 @@ module T
17
17
 
18
18
  def find(username)
19
19
  possibilities = Array(find_case_insensitive_match(username) || find_case_insensitive_possibilities(username))
20
- if possibilities.size == 1
21
- possibilities.first
22
- else
23
- fail(ArgumentError.new("Username #{username} is #{possibilities.size < 1 ? 'not found.' : 'ambiguous, matching ' + possibilities.join(', ')}"))
24
- end
20
+ raise(ArgumentError.new("Username #{username} is #{possibilities.empty? ? 'not found.' : 'ambiguous, matching ' + possibilities.join(', ')}")) unless possibilities.size == 1
21
+ possibilities.first
25
22
  end
26
23
 
27
24
  def find_case_insensitive_match(username)
@@ -118,7 +115,7 @@ module T
118
115
 
119
116
  def write
120
117
  require 'yaml'
121
- File.open(@path, File::RDWR | File::TRUNC | File::CREAT, 0600) do |rcfile|
118
+ File.open(@path, File::RDWR | File::TRUNC | File::CREAT, 0o0600) do |rcfile|
122
119
  rcfile.write @data.to_yaml
123
120
  end
124
121
  end
@@ -1,7 +1,7 @@
1
1
  module T
2
2
  class Version
3
- MAJOR = 2
4
- MINOR = 10
3
+ MAJOR = 3
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
data/t.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.add_dependency 'oauth', '~> 0.4.7'
11
11
  spec.add_dependency 'retryable', '~> 2.0'
12
12
  spec.add_dependency 'thor', ['>= 0.19.1', '< 2']
13
- spec.add_dependency 'twitter', '~> 5.16'
13
+ spec.add_dependency 'twitter', '~> 6.0'
14
14
  spec.add_development_dependency 'bundler', '~> 1.0'
15
15
  spec.author = 'Erik Michaels-Ober'
16
16
  spec.description = 'A command-line power tool for Twitter.'
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.licenses = %w(MIT)
22
22
  spec.name = 't'
23
23
  spec.require_paths = %w(lib)
24
- spec.required_ruby_version = '>= 1.9.3'
24
+ spec.required_ruby_version = '>= 2'
25
25
  spec.summary = 'CLI for Twitter'
26
26
  spec.version = T::Version
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: t
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Michaels-Ober
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-24 00:00:00.000000000 Z
11
+ date: 2016-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: launchy
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '5.16'
109
+ version: '6.0'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '5.16'
116
+ version: '6.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: bundler
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - ">="
171
171
  - !ruby/object:Gem::Version
172
- version: 1.9.3
172
+ version: '2'
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  requirements:
175
175
  - - ">="
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.5.1
180
+ rubygems_version: 2.5.2
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: CLI for Twitter