t 4.0.0 → 4.1.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
  SHA256:
3
- metadata.gz: c05206c20098de8ab33a4e694a46b2b38a35617dff2abc951f89ef6780a69f29
4
- data.tar.gz: 3072a72a478d93f3596a8a45c6b6be3cd6749c971fb5332d6e8badf9efe63faf
3
+ metadata.gz: f132b268c436dcf3e1107b9747e8dd3f506f1883970c27b152cd1b6b3239e217
4
+ data.tar.gz: 3c267e930330b7cd736e444b34b508e89e4eedf38124d69b13c15a79e38f49a1
5
5
  SHA512:
6
- metadata.gz: 44c7e0859b2f3cca023f9f261110eb1c4796fed4144f33575e046ae6b00700c42adf231c83e42a0273f65cc1c4816a9c2ea2cec8c88b8c102270ceb0c4514b1f
7
- data.tar.gz: ef0a67ecd302942a368f8cdcc49e3096455390423429cb23676b10e7ab7a6cad0a234e127f160854a9c9c355862e7468d7b64a5a92a7ce19c9afdaa990ca417d
6
+ metadata.gz: '0308f8a1a345f776f6226cd04d7ac6dce6d7532f63a1182c8fba908babf156ce7a4a0a2ee6674db01ddad1651dce06335d0f84a13388d6fb9851f6fd6d123be7'
7
+ data.tar.gz: 9804666bcde9a82bc9c8350c3f39b297c6c2c5c6629da53b8ebd96eaad80d46a6477779f8a15a467a773a9ccbcedf06fdb6d124e2b858f1307030c6c88d7405b
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2020 Erik Berlin
1
+ Copyright (c) 2011-2024 Erik Berlin
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -5,13 +5,11 @@
5
5
  [![Gem Version](https://img.shields.io/gem/v/t.svg)][gem]
6
6
  [![Build Status](https://img.shields.io/travis/sferik/t.svg)][travis]
7
7
  [![Dependency Status](https://img.shields.io/gemnasium/sferik/t.svg)][gemnasium]
8
- [![Coverage Status](https://img.shields.io/coveralls/sferik/t.svg)][coveralls]
9
8
  [![tip for next commit](https://tip4commit.com/projects/102.svg)](https://tip4commit.com/github/sferik/t)
10
9
 
11
10
  [gem]: https://rubygems.org/gems/t
12
11
  [travis]: https://travis-ci.org/sferik/t
13
12
  [gemnasium]: https://gemnasium.com/sferik/t
14
- [coveralls]: https://coveralls.io/r/sferik/t
15
13
 
16
14
  #### A command-line power tool for Twitter.
17
15
  The CLI takes syntactic cues from the [Twitter SMS commands][sms], but it
@@ -290,10 +288,9 @@ the original code.
290
288
  This library aims to support and is [tested against][travis] the following Ruby
291
289
  implementations:
292
290
 
293
- * Ruby 2.4
294
- * Ruby 2.5
295
- * Ruby 2.6
296
- * Ruby 2.7
291
+ * Ruby 3.1
292
+ * Ruby 3.2
293
+ * Ruby 3.3
297
294
 
298
295
  If something doesn't work on one of these Ruby versions, it's a bug.
299
296
 
@@ -314,7 +311,7 @@ If you are running t on a remote computer you can use the flag --display-uri dur
314
311
  t authorize --display-uri
315
312
 
316
313
  ## Copyright
317
- Copyright (c) 2011-2020 Erik Berlin. See [LICENSE][] for details.
314
+ Copyright (c) 2011-2024 Erik Berlin. See [LICENSE][] for details.
318
315
  Application icon by [@nvk][nvk].
319
316
 
320
317
  [license]: https://github.com/sferik/t/blob/master/LICENSE.md
data/lib/t/cli.rb CHANGED
@@ -580,11 +580,9 @@ module T
580
580
  desc "reach TWEET_ID", "Shows the maximum number of people who may have seen the specified tweet in their timeline."
581
581
  def reach(tweet_id)
582
582
  require "t/core_ext/string"
583
- require "set"
584
583
  status_thread = Thread.new { client.status(tweet_id.to_i, include_my_retweet: false) }
585
- threads = []
586
- client.retweeters_ids(tweet_id.to_i).each do |retweeter_id|
587
- threads << Thread.new(retweeter_id) do |user_id|
584
+ threads = client.retweeters_ids(tweet_id.to_i).collect do |retweeter_id|
585
+ Thread.new(retweeter_id) do |user_id|
588
586
  client.follower_ids(user_id).to_a
589
587
  end
590
588
  end
@@ -966,7 +964,7 @@ module T
966
964
  ([a-zA-Z0-9_]{1,20}) # $3: Screen name
967
965
  /ox
968
966
 
969
- return [] if text !~ at_signs
967
+ return [] unless text&.match?(at_signs)
970
968
 
971
969
  text.to_s.scan(valid_mentions).collect do |_, _, screen_name|
972
970
  screen_name
@@ -991,7 +989,7 @@ module T
991
989
  return nil unless options["location"]
992
990
 
993
991
  lat, lng = options["location"] == "location" ? [location.lat, location.lng] : options["location"].split(",").collect(&:to_f)
994
- opts.merge!(lat: lat, long: lng)
992
+ opts.merge!(lat:, long: lng)
995
993
  end
996
994
 
997
995
  def location
data/lib/t/collectable.rb CHANGED
@@ -1,20 +1,19 @@
1
1
  require "twitter"
2
2
  require "retryable"
3
- require "set"
4
3
 
5
4
  module T
6
5
  module Collectable
7
6
  MAX_NUM_RESULTS = 200
8
7
  MAX_PAGE = 51
9
8
 
10
- def collect_with_max_id(collection = [], max_id = nil, &block)
9
+ def collect_with_max_id(collection = [], max_id = nil, &)
11
10
  tweets = Retryable.retryable(tries: 3, on: Twitter::Error, sleep: 0) do
12
11
  yield(max_id)
13
12
  end
14
13
  return collection if tweets.nil?
15
14
 
16
15
  collection += tweets
17
- tweets.empty? ? collection.flatten : collect_with_max_id(collection, tweets.last.id - 1, &block)
16
+ tweets.empty? ? collection.flatten : collect_with_max_id(collection, tweets.last.id - 1, &)
18
17
  end
19
18
 
20
19
  def collect_with_count(count)
@@ -31,14 +30,14 @@ module T
31
30
  end.flatten.compact
32
31
  end
33
32
 
34
- def collect_with_page(collection = ::Set.new, page = 1, previous = nil, &block)
33
+ def collect_with_page(collection = ::Set.new, page = 1, previous = nil, &)
35
34
  tweets = Retryable.retryable(tries: 3, on: Twitter::Error, sleep: 0) do
36
35
  yield page
37
36
  end
38
37
  return collection if tweets.nil? || tweets == previous || page >= MAX_PAGE
39
38
 
40
39
  collection += tweets
41
- tweets.empty? ? collection.flatten : collect_with_page(collection, page + 1, tweets, &block)
40
+ tweets.empty? ? collection.flatten : collect_with_page(collection, page + 1, tweets, &)
42
41
  end
43
42
  end
44
43
  end
data/lib/t/editor.rb CHANGED
@@ -26,7 +26,7 @@ module T
26
26
  end
27
27
 
28
28
  def system_editor
29
- RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ ? "notepad" : "vi"
29
+ /mswin|mingw/.match?(RbConfig::CONFIG["host_os"]) ? "notepad" : "vi"
30
30
  end
31
31
  end
32
32
  end
data/lib/t/list.rb CHANGED
@@ -41,7 +41,7 @@ module T
41
41
  desc "create LIST [DESCRIPTION]", "Create a new list."
42
42
  method_option "private", aliases: "-p", type: :boolean
43
43
  def create(list_name, description = nil)
44
- opts = description ? {description: description} : {}
44
+ opts = description ? {description:} : {}
45
45
  opts[:mode] = "private" if options["private"]
46
46
  client.create_list(list_name, opts)
47
47
  say "@#{@rcfile.active_profile[0]} created the list \"#{list_name}\"."
data/lib/t/printable.rb CHANGED
@@ -140,7 +140,7 @@ module T
140
140
  icon = Identicon.for_user_name(from_user)
141
141
 
142
142
  # Save 6 chars for icon, ensure at least 3 lines long
143
- lines = wrapped(HTMLEntities.new.decode(message), indent: 2, width: terminal_width - (6 + 5))
143
+ lines = wrapped(HTMLEntities.new.decode(message), indent: 2, width: Thor::Shell::Terminal.terminal_width - (6 + 5))
144
144
  lines.unshift(set_color(" @#{from_user}", :bold, :yellow))
145
145
  lines.concat(Array.new([3 - lines.length, 0].max) { "" })
146
146
 
@@ -149,7 +149,7 @@ module T
149
149
 
150
150
  def wrapped(message, options = {})
151
151
  indent = options[:indent] || 0
152
- width = options[:width] || (terminal_width - indent)
152
+ width = options[:width] || (Thor::Shell::Terminal.terminal_width - indent)
153
153
  paras = message.split("\n\n")
154
154
 
155
155
  paras.map! do |unwrapped|
data/lib/t/search.rb CHANGED
@@ -204,7 +204,7 @@ module T
204
204
  method_option "unsorted", aliases: "-u", type: :boolean, desc: "Output is not sorted."
205
205
  def users(query)
206
206
  users = collect_with_page do |page|
207
- client.user_search(query, page: page)
207
+ client.user_search(query, page:)
208
208
  end
209
209
  print_users(users)
210
210
  end
data/lib/t/set.rb CHANGED
@@ -26,7 +26,7 @@ module T
26
26
 
27
27
  desc "bio DESCRIPTION", "Edits your Bio information on your Twitter profile."
28
28
  def bio(description)
29
- client.update_profile(description: description)
29
+ client.update_profile(description:)
30
30
  say "@#{@rcfile.active_profile[0]}'s bio has been updated."
31
31
  end
32
32
 
@@ -44,7 +44,7 @@ module T
44
44
 
45
45
  desc "name NAME", "Sets the name field on your Twitter profile."
46
46
  def name(name)
47
- client.update_profile(name: name)
47
+ client.update_profile(name:)
48
48
  say "@#{@rcfile.active_profile[0]}'s name has been updated."
49
49
  end
50
50
 
data/lib/t/utils.rb CHANGED
@@ -14,12 +14,12 @@ module T
14
14
  when 1...2
15
15
  "a second"
16
16
  when 2...60
17
- format("%<seconds>d seconds", seconds: seconds)
17
+ format("%<seconds>d seconds", seconds:)
18
18
  end
19
19
  when 1...2
20
20
  "a minute"
21
21
  when 2...60
22
- format("%<minutes>d minutes", minutes: minutes)
22
+ format("%<minutes>d minutes", minutes:)
23
23
  when 60...120
24
24
  "an hour"
25
25
  # 120 minutes up to 23.5 hours
data/lib/t/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module T
2
2
  class Version
3
3
  MAJOR = 4
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
data/t.gemspec CHANGED
@@ -5,13 +5,13 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "t/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.add_dependency "geokit", "~> 1.9"
8
+ spec.add_dependency "geokit", "~> 1.14"
9
9
  spec.add_dependency "htmlentities", "~> 4.3"
10
- spec.add_dependency "launchy", "~> 2.4"
11
- spec.add_dependency "oauth", "~> 0.5.1"
10
+ spec.add_dependency "launchy", "~> 3.0"
11
+ spec.add_dependency "oauth", "~> 1.1"
12
12
  spec.add_dependency "retryable", "~> 3.0"
13
- spec.add_dependency "thor", [">= 0.19.1", "< 2"]
14
- spec.add_dependency "twitter", "~> 8.0"
13
+ spec.add_dependency "thor", "~> 1.3"
14
+ spec.add_dependency "twitter", "~> 8.1"
15
15
  spec.author = "Erik Berlin"
16
16
  spec.description = "A command-line power tool for Twitter."
17
17
  spec.email = "sferik@gmail.com"
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.metadata["rubygems_mfa_required"] = "true"
23
23
  spec.name = "t"
24
24
  spec.require_paths = %w[lib]
25
- spec.required_ruby_version = ">= 3.0"
25
+ spec.required_ruby_version = ">= 3.1.4"
26
26
  spec.summary = "CLI for Twitter"
27
27
  spec.version = T::Version
28
28
  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: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Berlin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-30 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: geokit
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '1.14'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '1.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: htmlentities
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.4'
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.4'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: oauth
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.5.1
61
+ version: '1.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.5.1
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: retryable
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,36 +84,30 @@ dependencies:
84
84
  name: thor
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: 0.19.1
90
- - - "<"
87
+ - - "~>"
91
88
  - !ruby/object:Gem::Version
92
- version: '2'
89
+ version: '1.3'
93
90
  type: :runtime
94
91
  prerelease: false
95
92
  version_requirements: !ruby/object:Gem::Requirement
96
93
  requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- version: 0.19.1
100
- - - "<"
94
+ - - "~>"
101
95
  - !ruby/object:Gem::Version
102
- version: '2'
96
+ version: '1.3'
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: twitter
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
101
  - - "~>"
108
102
  - !ruby/object:Gem::Version
109
- version: '8.0'
103
+ version: '8.1'
110
104
  type: :runtime
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
108
  - - "~>"
115
109
  - !ruby/object:Gem::Version
116
- version: '8.0'
110
+ version: '8.1'
117
111
  description: A command-line power tool for Twitter.
118
112
  email: sferik@gmail.com
119
113
  executables:
@@ -156,14 +150,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
150
  requirements:
157
151
  - - ">="
158
152
  - !ruby/object:Gem::Version
159
- version: '3.0'
153
+ version: 3.1.4
160
154
  required_rubygems_version: !ruby/object:Gem::Requirement
161
155
  requirements:
162
156
  - - ">="
163
157
  - !ruby/object:Gem::Version
164
158
  version: '0'
165
159
  requirements: []
166
- rubygems_version: 3.4.12
160
+ rubygems_version: 3.5.9
167
161
  signing_key:
168
162
  specification_version: 4
169
163
  summary: CLI for Twitter