t 4.0.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -1
- data/README.md +4 -7
- data/lib/t/cli.rb +4 -6
- data/lib/t/collectable.rb +4 -5
- data/lib/t/editor.rb +1 -1
- data/lib/t/list.rb +1 -1
- data/lib/t/printable.rb +2 -2
- data/lib/t/search.rb +1 -1
- data/lib/t/set.rb +2 -2
- data/lib/t/utils.rb +2 -2
- data/lib/t/version.rb +2 -2
- data/t.gemspec +6 -6
- metadata +16 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bede60a8cf1dc57bd987fd3c075f9a3b06b44e2b105b8dbd29490e96a4ba58e5
|
4
|
+
data.tar.gz: c70b0163bf2f558a24aee09565f2cc2cf0a220cf2de8dbcf7c4ae55f6ad7295b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fa36efe2a08866da7699f5a078e9e06fad583ecba6e71c74d093514ac20abf4e6f813c2dfcf881d69be59166414e0803301e04619ca63fa261f1457eea55ad7
|
7
|
+
data.tar.gz: 38e28e3574e253eed3aaa526051874e58ee03c0b8e926e2e78a909b501f20eef14a5ce0807b4669a8b75da667633468548e9802329b74cd999bb753ef03fbd7c
|
data/LICENSE.md
CHANGED
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
|
294
|
-
* Ruby 2
|
295
|
-
* Ruby
|
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-
|
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
|
-
|
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 []
|
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
|
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, &
|
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, &
|
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, &
|
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, &
|
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
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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
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.
|
8
|
+
spec.add_dependency "geokit", "~> 1.14"
|
9
9
|
spec.add_dependency "htmlentities", "~> 4.3"
|
10
|
-
spec.add_dependency "launchy", "~>
|
11
|
-
spec.add_dependency "oauth", "~>
|
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",
|
14
|
-
spec.add_dependency "twitter", "~> 8.
|
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.
|
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.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Berlin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
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.
|
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.
|
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: '
|
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: '
|
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:
|
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:
|
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: '
|
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: '
|
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.
|
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.
|
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:
|
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.
|
160
|
+
rubygems_version: 3.5.9
|
167
161
|
signing_key:
|
168
162
|
specification_version: 4
|
169
163
|
summary: CLI for Twitter
|