termtter 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/Rakefile +1 -1
  2. data/lib/plugins/bomb.rb +9 -12
  3. data/lib/plugins/expand-tinyurl.rb +12 -3
  4. data/lib/plugins/group.rb +10 -6
  5. data/lib/plugins/history.rb +21 -10
  6. data/lib/plugins/log.rb +10 -10
  7. data/lib/plugins/msagent.rb +23 -11
  8. data/lib/plugins/notify-send.rb +17 -12
  9. data/lib/plugins/say.rb +8 -6
  10. data/lib/plugins/scrape.rb +1 -1
  11. data/lib/plugins/screen-notify.rb +17 -10
  12. data/lib/plugins/standard_plugins.rb +29 -17
  13. data/lib/plugins/stdout.rb +35 -54
  14. data/lib/plugins/storage.rb +17 -23
  15. data/lib/plugins/storage/status.rb +23 -20
  16. data/lib/plugins/update_editor.rb +1 -1
  17. data/lib/plugins/uri-open.rb +7 -5
  18. data/lib/plugins/url_addspace.rb +2 -2
  19. data/lib/termtter/api.rb +2 -1
  20. data/lib/termtter/client.rb +88 -108
  21. data/lib/termtter/command.rb +1 -0
  22. data/lib/termtter/hook.rb +5 -0
  23. data/lib/termtter/system_extensions.rb +13 -3
  24. data/lib/termtter/version.rb +1 -1
  25. data/spec/{plugin → plugins}/cool_spec.rb +0 -0
  26. data/spec/{plugin → plugins}/english_spec.rb +0 -0
  27. data/spec/{plugin → plugins}/favorite_spec.rb +0 -0
  28. data/spec/{plugin → plugins}/fib_spec.rb +0 -0
  29. data/spec/{plugin → plugins}/filter_spec.rb +0 -0
  30. data/spec/{plugin → plugins}/pause_spec.rb +0 -0
  31. data/spec/{plugin → plugins}/plugin_spec.rb +0 -0
  32. data/spec/{plugin → plugins}/primes_spec.rb +0 -0
  33. data/spec/{plugin → plugins}/shell_spec.rb +0 -0
  34. data/spec/{plugin → plugins}/sl_spec.rb +0 -0
  35. data/spec/{plugin → plugins}/spam_spec.rb +0 -0
  36. data/spec/{plugin → plugins}/standard_plugins_spec.rb +0 -0
  37. data/spec/{plugin → plugins}/storage/DB_spec.rb +0 -0
  38. data/spec/{plugin → plugins}/storage/status_spec.rb +1 -1
  39. data/spec/termtter/client_spec.rb +1 -4
  40. metadata +17 -17
@@ -57,6 +57,7 @@ module Termtter
57
57
  end
58
58
 
59
59
  # return array like [command, arg]
60
+ # match? メソッドがなんかきもちわるいので変える予定
60
61
  def match?(input)
61
62
  if pattern =~ input
62
63
  [$2 || $3, $4] # $2 or $3 => command, $4 => argument
data/lib/termtter/hook.rb CHANGED
@@ -23,5 +23,10 @@ module Termtter
23
23
  end
24
24
  }.empty?
25
25
  end
26
+
27
+ # TODO: need spec
28
+ def execute(*args)
29
+ self.exec_proc.call(*args)
30
+ end
26
31
  end
27
32
  end
@@ -25,14 +25,24 @@ require 'dl/import'
25
25
  module Readline
26
26
  begin
27
27
  module LIBREADLINE
28
- extend DL::Importable
29
- dlload '/opt/local/lib/libreadline.dylib' # TODO: 環境によってパスを変える必要あり。どうやったらいいかはこれから調べる。
28
+ if DL.const_defined? :Importable
29
+ extend DL::Importable
30
+ else
31
+ extend DL::Importer
32
+ end
33
+ pathes = Array(ENV['TERMTTER_EXT_LIB'] || [
34
+ '/opt/local/lib/libreadline.dylib',
35
+ '/usr/lib/libreadline.so',
36
+ '/usr/local/lib/libreadline.so',
37
+ File.join(Gem.bindir, 'readline.dll')
38
+ ])
39
+ dlload(pathes.find { |path| File.exist?(path)})
30
40
  extern 'int rl_refresh_line(int, int)'
31
41
  end
32
42
  def self.refresh_line
33
43
  LIBREADLINE.rl_refresh_line(0, 0)
34
44
  end
35
- rescue RuntimeError, NameError
45
+ rescue Exception
36
46
  def self.refresh_line;end
37
47
  end
38
48
  end
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module Termtter
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -17,7 +17,7 @@ module Termtter::Storage
17
17
  :created_at => 12345,
18
18
  :in_reply_to_status_id => -1,
19
19
  :in_reply_to_user_id => -1,
20
- :post_text => 'bomb',
20
+ :text => 'bomb',
21
21
  :user_id => 1).should_not be_false
22
22
  end
23
23
  end
@@ -176,15 +176,12 @@ module Termtter
176
176
  end
177
177
 
178
178
  it 'run' do
179
- Client.should_receive(:puts)
180
179
  Client.should_receive(:load_default_plugins)
181
180
  Client.should_receive(:load_config)
182
181
  Termtter::API.should_receive(:setup)
183
- Client.should_receive(:pre_config_load)
184
- Client.should_receive(:call_hooks)
182
+ Client.should_receive(:post_config_load)
185
183
  Client.should_receive(:call_new_hooks)
186
184
  Client.should_receive(:setup_update_timeline_task)
187
- Client.should_receive(:call_commands)
188
185
  Client.should_receive(:start_input_thread)
189
186
  Client.run
190
187
  end
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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-03-18 00:00:00 +09:00
13
+ date: 2009-03-21 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.4.8
54
+ version: 0.5.0
55
55
  version:
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: sqlite3-ruby
@@ -150,20 +150,20 @@ files:
150
150
  - lib/termtter/task_manager.rb
151
151
  - lib/termtter/version.rb
152
152
  - lib/termtter.rb
153
- - spec/plugin/cool_spec.rb
154
- - spec/plugin/english_spec.rb
155
- - spec/plugin/favorite_spec.rb
156
- - spec/plugin/fib_spec.rb
157
- - spec/plugin/filter_spec.rb
158
- - spec/plugin/pause_spec.rb
159
- - spec/plugin/plugin_spec.rb
160
- - spec/plugin/primes_spec.rb
161
- - spec/plugin/shell_spec.rb
162
- - spec/plugin/sl_spec.rb
163
- - spec/plugin/spam_spec.rb
164
- - spec/plugin/standard_plugins_spec.rb
165
- - spec/plugin/storage/DB_spec.rb
166
- - spec/plugin/storage/status_spec.rb
153
+ - spec/plugins/cool_spec.rb
154
+ - spec/plugins/english_spec.rb
155
+ - spec/plugins/favorite_spec.rb
156
+ - spec/plugins/fib_spec.rb
157
+ - spec/plugins/filter_spec.rb
158
+ - spec/plugins/pause_spec.rb
159
+ - spec/plugins/plugin_spec.rb
160
+ - spec/plugins/primes_spec.rb
161
+ - spec/plugins/shell_spec.rb
162
+ - spec/plugins/sl_spec.rb
163
+ - spec/plugins/spam_spec.rb
164
+ - spec/plugins/standard_plugins_spec.rb
165
+ - spec/plugins/storage/DB_spec.rb
166
+ - spec/plugins/storage/status_spec.rb
167
167
  - spec/spec_helper.rb
168
168
  - spec/termtter/client_spec.rb
169
169
  - spec/termtter/command_spec.rb