termtter 2.2.6 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/termtter_frame +2 -1
- data/lib/plugins/channel.rb +3 -1
- data/lib/plugins/defaults/auto_reload.rb +4 -1
- data/lib/plugins/defaults/command_line.rb +2 -1
- data/lib/plugins/defaults/list.rb +3 -1
- data/lib/plugins/defaults/standard_commands.rb +8 -3
- data/lib/termtter/client.rb +2 -1
- data/lib/termtter/rubytter_proxy.rb +2 -2
- data/lib/termtter/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/termtter/rubytter_proxy_spec.rb +2 -2
- data/termtter.gemspec +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f2087319bfeaa1ab882a0daa8c731f94f6ea3e6
|
4
|
+
data.tar.gz: b41f3e01ce363cb58d4b6baa8092d52b6ff92a5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3a69cdd140829bd2f7ffc2ca4d94acb8d5b79dbe1d33b38f93069979abd0a334e1b04e337a25f32ca6f63389a68240060c50c3082a9a9a069a03d9247425b64
|
7
|
+
data.tar.gz: 286373eddf8fa026d3caa3be3bda55f8717074bd46637e20ec4e3bc846f4ab68fc8f7e53b9b4736770dd80ab4c80b40dabd9f89c719931603cdb403dcd43a60f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.8
|
data/bin/termtter_frame
CHANGED
@@ -14,6 +14,7 @@ ARGV.unshift '-m' unless ARGV.include?('-m') #monochrome
|
|
14
14
|
|
15
15
|
require 'singleton'
|
16
16
|
require 'termtter'
|
17
|
+
require 'timeout'
|
17
18
|
|
18
19
|
module Termtter
|
19
20
|
class CommandLine
|
@@ -52,7 +53,7 @@ module Termtter
|
|
52
53
|
hooks.each {|hook|
|
53
54
|
hook.call(command_text)
|
54
55
|
}
|
55
|
-
rescue
|
56
|
+
rescue Timeout::Error
|
56
57
|
puts TermColor.parse("<red>Time out :(</red>")
|
57
58
|
end
|
58
59
|
|
data/lib/plugins/channel.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'timeout'
|
2
|
+
|
1
3
|
config.plugins.channel.set_default(:auto_reload_channels, {})
|
2
4
|
config.plugins.channel.set_default(:short_names, {})
|
3
5
|
config.plugins.channel.set_default(:colorize, true)
|
@@ -139,7 +141,7 @@ config.plugins.channel.auto_reload_channels.each do |c, i|
|
|
139
141
|
Readline.refresh_line
|
140
142
|
end
|
141
143
|
end
|
142
|
-
rescue
|
144
|
+
rescue Timeout::Error
|
143
145
|
# do nothing
|
144
146
|
rescue Exception => e
|
145
147
|
Termtter::Client.handle_error(e)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require 'singleton'
|
3
|
+
require 'timeout'
|
3
4
|
|
4
5
|
module Termtter
|
5
6
|
class CommandLine
|
@@ -38,7 +39,7 @@ module Termtter
|
|
38
39
|
hooks.each {|hook|
|
39
40
|
hook.call(command_text)
|
40
41
|
}
|
41
|
-
rescue
|
42
|
+
rescue Timeout::Error
|
42
43
|
puts TermColor.parse("<red>Time out :(</red>")
|
43
44
|
end
|
44
45
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'timeout'
|
2
|
+
|
1
3
|
module Termtter::Client
|
2
4
|
public_storage[:lists] = []
|
3
5
|
|
@@ -5,7 +7,7 @@ module Termtter::Client
|
|
5
7
|
begin
|
6
8
|
public_storage[:lists] +=
|
7
9
|
Termtter::API.twitter.lists(:screen_name => config.user_name).map(&:full_name)
|
8
|
-
rescue
|
10
|
+
rescue Timeout::Error
|
9
11
|
# do nothing
|
10
12
|
rescue Exception => e
|
11
13
|
Termtter::Client.handle_error(e)
|
@@ -31,7 +31,7 @@ module Termtter::Client
|
|
31
31
|
)
|
32
32
|
|
33
33
|
register_command(
|
34
|
-
:name => :update, :
|
34
|
+
:name => :update, :aliases => [:u, :a],
|
35
35
|
:exec => lambda {|arg|
|
36
36
|
return if arg.empty?
|
37
37
|
params =
|
@@ -71,7 +71,7 @@ module Termtter::Client
|
|
71
71
|
)
|
72
72
|
|
73
73
|
register_command(
|
74
|
-
:name => :delete, :aliases =>[:del],
|
74
|
+
:name => :delete, :aliases =>[:del, :rm],
|
75
75
|
:exec_proc => lambda {|arg|
|
76
76
|
id =
|
77
77
|
case arg
|
@@ -327,7 +327,7 @@ module Termtter::Client
|
|
327
327
|
end
|
328
328
|
|
329
329
|
register_command(
|
330
|
-
:name => :favorite, :aliases => [:fav],
|
330
|
+
:name => :favorite, :aliases => [:fav, :f],
|
331
331
|
:exec_proc => lambda {|args|
|
332
332
|
args.split(' ').each do |arg|
|
333
333
|
id =
|
@@ -342,6 +342,11 @@ module Termtter::Client
|
|
342
342
|
when %r{twitter.com/(?:\#!/)[A-Za-z0-9_]+/status(?:es)?/\d+},
|
343
343
|
%r{twitter.com/[A-Za-z0-9_]+}
|
344
344
|
URI.parse(arg).path.split(%{/}).last.to_i
|
345
|
+
when /^([A-Za-z0-9_]+)/
|
346
|
+
user_name = $1
|
347
|
+
statuses = Termtter::API.twitter.user_timeline(:screen_name => user_name)
|
348
|
+
return if statuses.empty?
|
349
|
+
statuses[0].id
|
345
350
|
when /^\/(.*)$/
|
346
351
|
word = $1
|
347
352
|
raise "Not implemented yet."
|
data/lib/termtter/client.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'fileutils'
|
3
3
|
require 'logger'
|
4
4
|
require 'termcolor'
|
5
|
+
require 'timeout'
|
5
6
|
|
6
7
|
module Termtter
|
7
8
|
class CommandNotFound < StandardError; end
|
@@ -187,7 +188,7 @@ module Termtter
|
|
187
188
|
end
|
188
189
|
return true
|
189
190
|
end
|
190
|
-
rescue
|
191
|
+
rescue Timeout::Error
|
191
192
|
call_hooks("timeout", text)
|
192
193
|
raise
|
193
194
|
end
|
@@ -40,7 +40,7 @@ module Termtter
|
|
40
40
|
|
41
41
|
self.class.call_hooks("post_#{method}", *args)
|
42
42
|
rescue HookCanceled
|
43
|
-
rescue
|
43
|
+
rescue Timeout::Error => e
|
44
44
|
Termtter::Client.logger.debug {
|
45
45
|
"rubytter_proxy: #{method}(#{modified_args.inspect[1...-1]}) " +
|
46
46
|
"#{e.message} #{'%.2fsec' % (Time.now - from)}"
|
@@ -147,7 +147,7 @@ module Termtter
|
|
147
147
|
else
|
148
148
|
raise e
|
149
149
|
end
|
150
|
-
rescue StandardError,
|
150
|
+
rescue StandardError, Timeout::Error => e
|
151
151
|
if now + 1 == config.retry
|
152
152
|
raise e
|
153
153
|
else
|
data/lib/termtter/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -50,10 +50,10 @@ module Termtter
|
|
50
50
|
@twitter.update('test')
|
51
51
|
end
|
52
52
|
|
53
|
-
it 'should retry when raise
|
53
|
+
it 'should retry when raise Timeout::Error' do
|
54
54
|
pending("Not yet implemented")
|
55
55
|
config.retry = 3
|
56
|
-
@rubytter_mock.stub!(:update).exactly(config.retry).times.and_raise(
|
56
|
+
@rubytter_mock.stub!(:update).exactly(config.retry).times.and_raise(Timeout::Error)
|
57
57
|
@twitter.update('test')
|
58
58
|
end
|
59
59
|
|
data/termtter.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: termtter 2.2.
|
5
|
+
# stub: termtter 2.2.8 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "termtter".freeze
|
9
|
-
s.version = "2.2.
|
9
|
+
s.version = "2.2.8"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["jugyo".freeze, "ujihisa".freeze, "koichiroo".freeze, "id774".freeze]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2017-07-14"
|
15
15
|
s.description = "Termtter is a terminal based Twitter client.".freeze
|
16
16
|
s.email = "jugyo.org@gmail.com".freeze
|
17
17
|
s.executables = ["termtter".freeze, "termtter_frame".freeze]
|
@@ -307,7 +307,7 @@ Gem::Specification.new do |s|
|
|
307
307
|
s.homepage = "http://termtter.github.com/".freeze
|
308
308
|
s.licenses = ["MIT".freeze]
|
309
309
|
s.rubyforge_project = "termtter".freeze
|
310
|
-
s.rubygems_version = "2.6.
|
310
|
+
s.rubygems_version = "2.6.6".freeze
|
311
311
|
s.summary = "Terminal based Twitter client.".freeze
|
312
312
|
|
313
313
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: termtter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jugyo
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: json
|