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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7e000b69aea25e18676191aba4517ae86647eb8
4
- data.tar.gz: 34196c9c651731e98f4cb609bac2f519fe6f6158
3
+ metadata.gz: 5f2087319bfeaa1ab882a0daa8c731f94f6ea3e6
4
+ data.tar.gz: b41f3e01ce363cb58d4b6baa8092d52b6ff92a5c
5
5
  SHA512:
6
- metadata.gz: 202b121eb9e91d11106a46489b64bad1f4be65c9201aef3855e7a6ac1e8570aa147d21a97fbc51b2ae96915e3317032db119cbb56eb95f959c91e4d8f407ea90
7
- data.tar.gz: 346978e1ace663bef7e9bc58302a06148ccbf55d88bbb69fa87c13abcccc535e1b06c2ef729c6ac6ae281bc78e04469ca771c0740503801055a3da5833f67908
6
+ metadata.gz: d3a69cdd140829bd2f7ffc2ca4d94acb8d5b79dbe1d33b38f93069979abd0a334e1b04e337a25f32ca6f63389a68240060c50c3082a9a9a069a03d9247425b64
7
+ data.tar.gz: 286373eddf8fa026d3caa3be3bda55f8717074bd46637e20ec4e3bc846f4ab68fc8f7e53b9b4736770dd80ab4c80b40dabd9f89c719931603cdb403dcd43a60f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.6
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 TimeoutError
56
+ rescue Timeout::Error
56
57
  puts TermColor.parse("<red>Time out :(</red>")
57
58
  end
58
59
 
@@ -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 TimeoutError
144
+ rescue Timeout::Error
143
145
  # do nothing
144
146
  rescue Exception => e
145
147
  Termtter::Client.handle_error(e)
@@ -1,8 +1,11 @@
1
1
  # -*- coding: utf-8 -*-
2
+
3
+ require 'timeout'
4
+
2
5
  auto_reload_proc = lambda do
3
6
  begin
4
7
  Termtter::Client.execute('reload -r')
5
- rescue TimeoutError
8
+ rescue Timeout::Error
6
9
  # do nothing
7
10
  rescue
8
11
  rescue Exception => 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 TimeoutError
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 TimeoutError
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, :alias => :u,
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."
@@ -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 TimeoutError
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 TimeoutError => e
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, TimeoutError => e
150
+ rescue StandardError, Timeout::Error => e
151
151
  if now + 1 == config.retry
152
152
  raise e
153
153
  else
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Termtter
4
- VERSION = "2.2.6"
4
+ VERSION = "2.2.8"
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  $:.unshift(File.dirname(__FILE__) + '/../lib')
4
4
  ARGV.delete '-c'
5
5
  require 'termtter'
6
+ require 'timeout'
6
7
 
7
8
  if ENV['COVERAGE'] == 'on'
8
9
  require 'simplecov'
@@ -50,10 +50,10 @@ module Termtter
50
50
  @twitter.update('test')
51
51
  end
52
52
 
53
- it 'should retry when raise TimeoutError' do
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(TimeoutError)
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.6 ruby lib
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.6"
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 = "2016-07-04"
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.4".freeze
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.6
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: 2016-07-04 00:00:00.000000000 Z
14
+ date: 2017-07-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json