t 3.1.0 → 4.0.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
- SHA1:
3
- metadata.gz: 864dd4cb66b11688ff534ea3a90ea95b8397e3fb
4
- data.tar.gz: 1ddaa027afd51be321daee9f46b62b24594c0899
2
+ SHA256:
3
+ metadata.gz: c05206c20098de8ab33a4e694a46b2b38a35617dff2abc951f89ef6780a69f29
4
+ data.tar.gz: 3072a72a478d93f3596a8a45c6b6be3cd6749c971fb5332d6e8badf9efe63faf
5
5
  SHA512:
6
- metadata.gz: 543cb8d65d78f4f062736240d907354c8fcf23eedb16f138e8dd10c335ec9c7fdf8777e71d4343bda15f99c8bbcfe336f1163ea17e750897722789ed24b1b946
7
- data.tar.gz: 60977b775338eb84864af689d8ab66baa7ff311cb417bfad0ae03721afc79836d7c28e0a8e8871685951356a73dca77e56d5b3f0f402386535d6422190f2568a
6
+ metadata.gz: 44c7e0859b2f3cca023f9f261110eb1c4796fed4144f33575e046ae6b00700c42adf231c83e42a0273f65cc1c4816a9c2ea2cec8c88b8c102270ceb0c4514b1f
7
+ data.tar.gz: ef0a67ecd302942a368f8cdcc49e3096455390423429cb23676b10e7ab7a6cad0a234e127f160854a9c9c355862e7468d7b64a5a92a7ce19c9afdaa990ca417d
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2016 Erik Michaels-Ober
1
+ Copyright (c) 2011-2020 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
@@ -31,6 +31,7 @@ If the output looks something like this, you're in good shape:
31
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
35
  [ruby]: https://www.ruby-lang.org/en/downloads/
35
36
 
36
37
  ruby: command not found
@@ -45,7 +46,8 @@ or for Red Hat-based distros like Fedora and CentOS, type:
45
46
 
46
47
  (if necessary, adapt for your package manager)
47
48
 
48
- **On Windows**, you can install Ruby with [RubyInstaller][].
49
+ **On Windows**, you can install Ruby with [RubyInstaller][rubyinstaller].
50
+
49
51
  [rubyinstaller]: http://rubyinstaller.org/downloads/
50
52
 
51
53
  ## Installation
@@ -199,7 +201,7 @@ example, here's how to send a user a direct message only if they already follow
199
201
 
200
202
  #### Search Tweets in your home timeline that match a specified query
201
203
  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.
204
+ **Note**: In Twitter API parlance, your “home timeline” is your “Newsfeed” whereas your “user timeline” are the tweets tweeted (and retweeted) by you.
203
205
 
204
206
  #### Search Tweets in a specified user’s timeline
205
207
  t search timeline @sferik "query"
@@ -288,10 +290,10 @@ the original code.
288
290
  This library aims to support and is [tested against][travis] the following Ruby
289
291
  implementations:
290
292
 
291
- * Ruby 2.0.0
292
- * Ruby 2.1
293
- * Ruby 2.2
294
- * Ruby 2.3
293
+ * Ruby 2.4
294
+ * Ruby 2.5
295
+ * Ruby 2.6
296
+ * Ruby 2.7
295
297
 
296
298
  If something doesn't work on one of these Ruby versions, it's a bug.
297
299
 
@@ -312,7 +314,7 @@ If you are running t on a remote computer you can use the flag --display-uri dur
312
314
  t authorize --display-uri
313
315
 
314
316
  ## Copyright
315
- Copyright (c) 2011-2016 Erik Michaels-Ober. See [LICENSE][] for details.
317
+ Copyright (c) 2011-2020 Erik Berlin. See [LICENSE][] for details.
316
318
  Application icon by [@nvk][nvk].
317
319
 
318
320
  [license]: https://github.com/sferik/t/blob/master/LICENSE.md
data/bin/t CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  # Trap interrupts to quit cleanly. See
4
4
  # https://twitter.com/mitchellh/status/283014103189053442
5
- Signal.trap('INT') { abort }
5
+ Signal.trap("INT") { abort }
6
6
 
7
- require 'oauth'
8
- require 't'
9
- require 'twitter'
7
+ require "oauth"
8
+ require "t"
9
+ require "twitter"
10
10
 
11
11
  # Output message to $stderr, prefixed with the program name
12
12
  def pute(*args)
@@ -19,24 +19,24 @@ end
19
19
  begin
20
20
  T::CLI.start(ARGV)
21
21
  rescue Interrupt
22
- pute 'Quitting...'
22
+ pute "Quitting..."
23
23
  rescue OAuth::Unauthorized
24
- pute 'Authorization failed'
25
- rescue Twitter::Error::TooManyRequests => error
26
- pute error.message, "The rate limit for this request will reset in #{error.rate_limit.reset_in} #{error.rate_limit.reset_in == 1 ? 'second' : 'seconds'}."
27
- rescue Twitter::Error::BadRequest => error
28
- pute error.message, 'Run `t authorize` to authorize.'
29
- rescue Twitter::Error::Forbidden, Twitter::Error::Unauthorized => error
30
- if error.message == 'Error processing your OAuth request: Read-only application cannot POST' ||
31
- error.message == 'This application is not allowed to access or delete your direct messages'
32
- $stderr.puts(%q(Make sure to set your Twitter application's Access Level to "Read, Write and Access direct messages".))
33
- require 'thor'
34
- Thor::Shell::Basic.new.ask 'Press [Enter] to open the Twitter Developer site.'
35
- require 'launchy'
36
- Launchy.open('https://dev.twitter.com/apps') { |u, _, _| $stderr.puts "Manually open #{u}" }
24
+ pute "Authorization failed"
25
+ rescue Twitter::Error::TooManyRequests => e
26
+ pute e.message, "The rate limit for this request will reset in #{e.rate_limit.reset_in} #{e.rate_limit.reset_in == 1 ? 'second' : 'seconds'}."
27
+ rescue Twitter::Error::BadRequest => e
28
+ pute e.message, "Run `t authorize` to authorize."
29
+ rescue Twitter::Error::Forbidden, Twitter::Error::Unauthorized => e
30
+ if e.message == "Error processing your OAuth request: Read-only application cannot POST" ||
31
+ e.message == "This application is not allowed to access or delete your direct messages"
32
+ warn(%q(Make sure to set your Twitter application's Access Level to "Read, Write and Access direct messages".))
33
+ require "thor"
34
+ Thor::Shell::Basic.new.ask "Press [Enter] to open the Twitter Developer site."
35
+ require "launchy"
36
+ Launchy.open("https://dev.twitter.com/apps") { |u, _, _| warn "Manually open #{u}" }
37
37
  else
38
- pute error.message
38
+ pute e.message
39
39
  end
40
- rescue Twitter::Error => error
41
- pute error.message
40
+ rescue Twitter::Error => e
41
+ pute e.message
42
42
  end