termtter 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. data/.gitignore +1 -1
  2. data/README.rdoc +1 -0
  3. data/Rakefile +2 -1
  4. data/VERSION +1 -1
  5. data/bin/termtter +1 -0
  6. data/bin/termtter_frame +134 -0
  7. data/lib/plugins/aa.rb +44 -0
  8. data/lib/plugins/another_prompt.rb +42 -41
  9. data/lib/plugins/appendtitle.rb +82 -0
  10. data/lib/plugins/ar.rb +11 -8
  11. data/lib/plugins/async.rb +3 -2
  12. data/lib/plugins/capital_update.rb +12 -0
  13. data/lib/plugins/channel.rb +149 -0
  14. data/lib/plugins/clock.rb +10 -0
  15. data/lib/plugins/defaults/command_line.rb +8 -0
  16. data/lib/plugins/defaults/confirm.rb +1 -1
  17. data/lib/plugins/defaults/hashtag.rb +1 -1
  18. data/lib/plugins/defaults/keyword.rb +11 -0
  19. data/lib/plugins/defaults/list.rb +32 -6
  20. data/lib/plugins/defaults/standard_commands.rb +135 -52
  21. data/lib/plugins/defaults/standard_completion.rb +14 -0
  22. data/lib/plugins/defaults/stdout.rb +59 -27
  23. data/lib/plugins/defaults/user.rb +32 -0
  24. data/lib/plugins/draft.rb +9 -12
  25. data/lib/plugins/easy_post.rb +5 -0
  26. data/lib/plugins/event_invoked_at.rb +23 -0
  27. data/lib/plugins/expand-tinyurl.rb +13 -20
  28. data/lib/plugins/favotter.rb +9 -9
  29. data/lib/plugins/footer.rb +9 -12
  30. data/lib/plugins/friends.rb +0 -26
  31. data/lib/plugins/grass.rb +2 -4
  32. data/lib/plugins/growl.rb +47 -0
  33. data/lib/plugins/gyazo.rb +16 -18
  34. data/lib/plugins/hi.rb +31 -10
  35. data/lib/plugins/http_server.rb +3 -2
  36. data/lib/plugins/irc_gw.rb +71 -17
  37. data/lib/plugins/line.rb +10 -0
  38. data/lib/plugins/linefeed.rb +6 -1
  39. data/lib/plugins/list_switch.rb +76 -0
  40. data/lib/plugins/nop.rb +9 -0
  41. data/lib/plugins/notify-send.rb +1 -1
  42. data/lib/plugins/notify-send2.rb +25 -16
  43. data/lib/plugins/notify-send3.rb +16 -13
  44. data/lib/plugins/nuance.rb +29 -0
  45. data/lib/plugins/open_url.rb +1 -5
  46. data/lib/plugins/random.rb +2 -6
  47. data/lib/plugins/reply_sound.rb +33 -0
  48. data/lib/plugins/say.rb +2 -2
  49. data/lib/plugins/storage/sqlite3.rb +1 -1
  50. data/lib/plugins/story.rb +44 -0
  51. data/lib/plugins/tinyurl.rb +50 -29
  52. data/lib/plugins/translate_tweet.rb +38 -0
  53. data/lib/plugins/web.rb +27 -0
  54. data/lib/termtter.rb +8 -4
  55. data/lib/termtter/client.rb +17 -21
  56. data/lib/termtter/command.rb +35 -13
  57. data/lib/termtter/config.rb +13 -0
  58. data/lib/termtter/config_template.erb +3 -2
  59. data/lib/termtter/default_config.rb +2 -2
  60. data/lib/termtter/event.rb +69 -0
  61. data/lib/termtter/hook.rb +6 -1
  62. data/lib/termtter/hookable.rb +9 -1
  63. data/lib/termtter/httppool.rb +17 -9
  64. data/lib/termtter/optparse.rb +11 -1
  65. data/lib/termtter/rubytter_proxy.rb +21 -5
  66. data/spec/plugins/capital_update_spec.rb +9 -0
  67. data/spec/plugins/fib_spec.rb +2 -4
  68. data/spec/plugins/hi_spec.rb +9 -0
  69. data/spec/plugins/tinyurl_spec.rb +78 -0
  70. data/spec/termtter/client_spec.rb +5 -12
  71. data/spec/termtter/command_spec.rb +22 -10
  72. data/spec/termtter/config_spec.rb +23 -0
  73. data/spec/termtter/event_spec.rb +129 -0
  74. data/spec/termtter/optparse_spec.rb +2 -2
  75. data/spec/termtter/rubytter_proxy_spec.rb +1 -1
  76. metadata +39 -8
  77. data/bin/kill_termtter +0 -22
  78. data/lib/plugins/defaults/users.rb +0 -63
  79. data/lib/plugins/pause.rb +0 -3
  80. data/test/friends_timeline.json +0 -5
  81. data/test/search.json +0 -8
@@ -22,12 +22,12 @@ module Termtter
22
22
 
23
23
  it 'accepts -f option' do
24
24
  Termtter::OptParser::parse!(%w{-f ~/config})
25
- config.system.conf_file.should == '~/config'
25
+ Termtter::CONF_FILE.should == '~/config'
26
26
  end
27
27
 
28
28
  it 'accepts -t option' do
29
29
  Termtter::OptParser::parse!(%w{-t ~/termtter_directory})
30
- config.system.conf_dir.should == '~/termtter_directory'
30
+ Termtter::CONF_DIR.should == '~/termtter_directory'
31
31
  end
32
32
 
33
33
  it 'accepts -d option' do
@@ -68,7 +68,7 @@ module Termtter
68
68
  it 'should store cache when call "store_status_cache"' do
69
69
  user = "user"
70
70
  @twitter.should_receive(:store_user_cache).with(user)
71
- @twitter.store_status_cache(Rubytter.structize({:user => user}))
71
+ @twitter.store_status_cache(ActiveRubytter.new({:user => user}))
72
72
  end
73
73
 
74
74
  it 'should not call rubytter if cache exists' do
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.7.2
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -10,11 +10,11 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-24 00:00:00 +09:00
13
+ date: 2010-04-10 00:00:00 +09:00
14
14
  default_executable: termtter
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: json_pure
17
+ name: json
18
18
  type: :runtime
19
19
  version_requirement:
20
20
  version_requirements: !ruby/object:Gem::Requirement
@@ -53,6 +53,16 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.11.0
55
55
  version:
56
+ - !ruby/object:Gem::Dependency
57
+ name: notify
58
+ type: :runtime
59
+ version_requirement:
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.2.1
65
+ version:
56
66
  description: Termtter is a terminal based Twitter client.
57
67
  email: jugyo.org@gmail.com
58
68
  executables:
@@ -68,18 +78,23 @@ files:
68
78
  - README.rdoc
69
79
  - Rakefile
70
80
  - VERSION
71
- - bin/kill_termtter
72
81
  - bin/termtter
82
+ - bin/termtter_frame
73
83
  - doc/Termtter-1.0-Release-Note-English.txt
74
84
  - doc/Termtter-1.0-Release-Note.txt
85
+ - lib/plugins/aa.rb
75
86
  - lib/plugins/addspace.rb
76
87
  - lib/plugins/another_prompt.rb
88
+ - lib/plugins/appendtitle.rb
77
89
  - lib/plugins/april_fool.rb
78
90
  - lib/plugins/ar.rb
79
91
  - lib/plugins/async.rb
80
92
  - lib/plugins/babelfish.rb
81
93
  - lib/plugins/bomb.rb
94
+ - lib/plugins/capital_update.rb
95
+ - lib/plugins/channel.rb
82
96
  - lib/plugins/clear.rb
97
+ - lib/plugins/clock.rb
83
98
  - lib/plugins/command_plus.rb
84
99
  - lib/plugins/confirm.rb
85
100
  - lib/plugins/cool.rb
@@ -105,12 +120,14 @@ files:
105
120
  - lib/plugins/defaults/standard_completion.rb
106
121
  - lib/plugins/defaults/stdout.rb
107
122
  - lib/plugins/defaults/switch.rb
108
- - lib/plugins/defaults/users.rb
123
+ - lib/plugins/defaults/user.rb
109
124
  - lib/plugins/draft.rb
125
+ - lib/plugins/easy_post.rb
110
126
  - lib/plugins/eject.rb
111
127
  - lib/plugins/en2ja.rb
112
128
  - lib/plugins/english.rb
113
129
  - lib/plugins/erb.rb
130
+ - lib/plugins/event_invoked_at.rb
114
131
  - lib/plugins/exec_and_update.rb
115
132
  - lib/plugins/expand-tinyurl.rb
116
133
  - lib/plugins/favotter.rb
@@ -145,7 +162,9 @@ files:
145
162
  - lib/plugins/jakigan.rb
146
163
  - lib/plugins/keyword.rb
147
164
  - lib/plugins/l2.rb
165
+ - lib/plugins/line.rb
148
166
  - lib/plugins/linefeed.rb
167
+ - lib/plugins/list_switch.rb
149
168
  - lib/plugins/list_with_opts.rb
150
169
  - lib/plugins/log.rb
151
170
  - lib/plugins/mark.rb
@@ -156,15 +175,16 @@ files:
156
175
  - lib/plugins/multi_output.rb
157
176
  - lib/plugins/multi_post.rb
158
177
  - lib/plugins/multi_reply.rb
178
+ - lib/plugins/nop.rb
159
179
  - lib/plugins/notify-send.rb
160
180
  - lib/plugins/notify-send2.rb
161
181
  - lib/plugins/notify-send3.rb
182
+ - lib/plugins/nuance.rb
162
183
  - lib/plugins/open.rb
163
184
  - lib/plugins/open_url.rb
164
185
  - lib/plugins/otsune.rb
165
186
  - lib/plugins/outputz.rb
166
187
  - lib/plugins/paranoid.rb
167
- - lib/plugins/pause.rb
168
188
  - lib/plugins/pool.rb
169
189
  - lib/plugins/post_exec_hook_sample.rb
170
190
  - lib/plugins/pre_exec_hook_sample.rb
@@ -180,6 +200,7 @@ files:
180
200
  - lib/plugins/replace.rb
181
201
  - lib/plugins/reply.rb
182
202
  - lib/plugins/reply_retweet.rb
203
+ - lib/plugins/reply_sound.rb
183
204
  - lib/plugins/reverse.rb
184
205
  - lib/plugins/say.rb
185
206
  - lib/plugins/saykanji.rb
@@ -196,12 +217,14 @@ files:
196
217
  - lib/plugins/storage/sqlite3.rb
197
218
  - lib/plugins/storage/status.rb
198
219
  - lib/plugins/storage/status_mook.rb
220
+ - lib/plugins/story.rb
199
221
  - lib/plugins/stream.rb
200
222
  - lib/plugins/switch_user.rb
201
223
  - lib/plugins/system_status.rb
202
224
  - lib/plugins/timer.rb
203
225
  - lib/plugins/tinyurl.rb
204
226
  - lib/plugins/train.rb
227
+ - lib/plugins/translate_tweet.rb
205
228
  - lib/plugins/translation.rb
206
229
  - lib/plugins/trends.rb
207
230
  - lib/plugins/truncate.rb
@@ -212,6 +235,7 @@ files:
212
235
  - lib/plugins/w3mimg.rb
213
236
  - lib/plugins/wassr.rb
214
237
  - lib/plugins/wassr_post.rb
238
+ - lib/plugins/web.rb
215
239
  - lib/plugins/whois.rb
216
240
  - lib/plugins/yhara.rb
217
241
  - lib/plugins/yhara_filter.rb
@@ -225,6 +249,7 @@ files:
225
249
  - lib/termtter/config_setup.rb
226
250
  - lib/termtter/config_template.erb
227
251
  - lib/termtter/default_config.rb
252
+ - lib/termtter/event.rb
228
253
  - lib/termtter/hook.rb
229
254
  - lib/termtter/hookable.rb
230
255
  - lib/termtter/httppool.rb
@@ -237,6 +262,7 @@ files:
237
262
  - lib/termtter/system_extensions/windows.rb
238
263
  - lib/termtter/task.rb
239
264
  - lib/termtter/task_manager.rb
265
+ - spec/plugins/capital_update_spec.rb
240
266
  - spec/plugins/cool_spec.rb
241
267
  - spec/plugins/curry_spec.rb
242
268
  - spec/plugins/db_spec.rb
@@ -252,6 +278,7 @@ files:
252
278
  - spec/plugins/footer_spec.rb
253
279
  - spec/plugins/gsub_spec.rb
254
280
  - spec/plugins/haml_spec.rb
281
+ - spec/plugins/hi_spec.rb
255
282
  - spec/plugins/md5pass_spec.rb
256
283
  - spec/plugins/pause_spec.rb
257
284
  - spec/plugins/primes_spec_.rb
@@ -261,6 +288,7 @@ files:
261
288
  - spec/plugins/standard_commands_spec.rb
262
289
  - spec/plugins/storage/sqlite3_spec.rb
263
290
  - spec/plugins/storage/status_spec_.rb
291
+ - spec/plugins/tinyurl_spec.rb
264
292
  - spec/plugins/truncate_spec.rb
265
293
  - spec/plugins/whois_spec_.rb
266
294
  - spec/spec_helper.rb
@@ -270,6 +298,7 @@ files:
270
298
  - spec/termtter/command_spec.rb
271
299
  - spec/termtter/config_setup_spec.rb
272
300
  - spec/termtter/config_spec.rb
301
+ - spec/termtter/event_spec.rb
273
302
  - spec/termtter/hook_spec.rb
274
303
  - spec/termtter/hookable_spec.rb
275
304
  - spec/termtter/memory_cache_spec.rb
@@ -280,8 +309,6 @@ files:
280
309
  - spec/termtter/task_manager_spec.rb
281
310
  - spec/termtter/task_spec.rb
282
311
  - spec/termtter_spec.rb
283
- - test/friends_timeline.json
284
- - test/search.json
285
312
  has_rdoc: true
286
313
  homepage: http://termtter.org/
287
314
  licenses: []
@@ -314,6 +341,7 @@ signing_key:
314
341
  specification_version: 3
315
342
  summary: Terminal based Twitter client.
316
343
  test_files:
344
+ - spec/plugins/capital_update_spec.rb
317
345
  - spec/plugins/cool_spec.rb
318
346
  - spec/plugins/curry_spec.rb
319
347
  - spec/plugins/db_spec.rb
@@ -329,6 +357,7 @@ test_files:
329
357
  - spec/plugins/footer_spec.rb
330
358
  - spec/plugins/gsub_spec.rb
331
359
  - spec/plugins/haml_spec.rb
360
+ - spec/plugins/hi_spec.rb
332
361
  - spec/plugins/md5pass_spec.rb
333
362
  - spec/plugins/pause_spec.rb
334
363
  - spec/plugins/primes_spec_.rb
@@ -338,6 +367,7 @@ test_files:
338
367
  - spec/plugins/standard_commands_spec.rb
339
368
  - spec/plugins/storage/sqlite3_spec.rb
340
369
  - spec/plugins/storage/status_spec_.rb
370
+ - spec/plugins/tinyurl_spec.rb
341
371
  - spec/plugins/truncate_spec.rb
342
372
  - spec/plugins/whois_spec_.rb
343
373
  - spec/spec_helper.rb
@@ -347,6 +377,7 @@ test_files:
347
377
  - spec/termtter/command_spec.rb
348
378
  - spec/termtter/config_setup_spec.rb
349
379
  - spec/termtter/config_spec.rb
380
+ - spec/termtter/event_spec.rb
350
381
  - spec/termtter/hook_spec.rb
351
382
  - spec/termtter/hookable_spec.rb
352
383
  - spec/termtter/memory_cache_spec.rb
data/bin/kill_termtter DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # If your termtter can't be exited, you might use this script.
3
- #
4
- # > exit
5
- # (no response...)
6
- # C-z
7
- # $ kill_termtter -i
8
- # y
9
- #
10
- # OPTION
11
- # -i interactive
12
- def s(a)
13
- puts a
14
- system a
15
- end
16
-
17
- `ps`.map(&:split).map {|i|
18
- pid, runner, file = i[0], i[4], i[5]
19
- if runner == 'ruby' && $$ != pid.to_i && /termtter/ =~ file
20
- s "kill -KILL #{pid}"
21
- end
22
- }
@@ -1,63 +0,0 @@
1
- module Termtter::Client
2
- register_command(
3
- :profile,
4
- :aliases => [:p],
5
- :help => ["user show USERNAME/[SLUG]", "Show user's profile."]
6
- ) do |arg|
7
- user_name = arg.empty? ? config.user_name : arg
8
- if user_name =~ /\//
9
- user_name, slug = *user_name.split('/')
10
- user_name = normalize_as_user_name(user_name)
11
- list = Termtter::API.twitter.list(user_name, slug)
12
- attrs = %w[ full_name slug description mode id member_count subscriber_count]
13
- label_width = attrs.map(&:size).max
14
- attrs.each do |attr|
15
- value = list.__send__(attr.to_sym)
16
- puts "#{attr.gsub('_', ' ').rjust(label_width)}: #{value}"
17
- end
18
- else
19
- user = Termtter::API.twitter.user(user_name)
20
- attrs = %w[ name screen_name url description profile_image_url location protected following
21
- friends_count followers_count statuses_count favourites_count
22
- id time_zone created_at utc_offset notifications
23
- ]
24
- label_width = attrs.map(&:size).max
25
- attrs.each do |attr|
26
- value = user.__send__(attr.to_sym)
27
- puts "#{attr.gsub('_', ' ').rjust(label_width)}: #{value}"
28
- end
29
- end
30
- end
31
-
32
- class UserSearchEvent; attr_reader :query; def initialize(query); @query = query end; end
33
-
34
- register_command(
35
- 'user search',
36
- :help => ["user search QUERY", "search users"]
37
- ) do |arg|
38
- search_option = config.user_search.option.empty? ? {} : config.user_search.option
39
- statuses = Termtter::API.twitter.search_user(arg, search_option)
40
- results = []
41
- statuses.select{|s| s.status != nil }.map do |s|
42
- result = {
43
- :id => s.status.id,
44
- :text => s.status.text,
45
- :in_reply_to_status_id => s.in_reply_to_status_id,
46
- :created_at => s.created_at,
47
- :user => {:id => s.id, :name => s.name, :screen_name => s.screen_name}
48
- }
49
- results << Rubytter.structize(result)
50
- end
51
- output(results, UserSearchEvent.new(arg))
52
- end
53
-
54
- register_hook(:highlight_for_user_search, :point => :pre_coloring) do |text, event|
55
- case event
56
- when UserSearchEvent
57
- query = event.query.split(/\s/).map {|q|Regexp.quote(q)}.join("|")
58
- text.gsub(/(#{query})(.*:)/i, '<on_magenta><white>\1</white></on_magenta>\2')
59
- else
60
- text
61
- end
62
- end
63
- end
data/lib/plugins/pause.rb DELETED
@@ -1,3 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- Termtter::Client.pause
@@ -1,5 +0,0 @@
1
- [
2
- {"in_reply_to_user_id":null,"truncated":false,"created_at":"Sat Jan 03 12:13:45 +0000 2009","user":{"description":"test2 xxxx","followers_count":102,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/000\/102.png","url":"http:\/\/twitter.com/test2","name":"Test User 2","protected":false,"screen_name":"test2","location":"Tokyo2","id":102},"favorited":false,"in_reply_to_screen_name":null,"text":"texttext 2","id":10002,"in_reply_to_status_id":null,"source":"<a href=\"http:\/\/ssss2\">ssss2<\/a>"},
3
- {"in_reply_to_user_id":null,"truncated":false,"created_at":"Sat Jan 03 12:13:45 +0000 2009","user":{"description":"test1 xxxx","followers_count":101,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/000\/101.png","url":"http:\/\/twitter.com/test1","name":"Test User 1","protected":false,"screen_name":"test1","location":"Tokyo1","id":101},"favorited":false,"in_reply_to_screen_name":null,"text":"texttext 1","id":10001,"in_reply_to_status_id":null,"source":"<a href=\"http:\/\/ssss1\">ssss1<\/a>"},
4
- {"in_reply_to_user_id":null,"truncated":false,"created_at":"Sat Jan 03 12:13:45 +0000 2009","user":{"description":"test0 xxxx","followers_count":100,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/000\/100.png","url":"http:\/\/twitter.com/test0","name":"Test User 0","protected":false,"screen_name":"test0","location":"Tokyo0","id":100},"favorited":false,"in_reply_to_screen_name":null,"text":"texttext 0","id":10000,"in_reply_to_status_id":null,"source":"<a href=\"http:\/\/ssss0\">ssss0<\/a>"}
5
- ]
data/test/search.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "results":[
3
- {"text":"texttext 2","to_user_id":202,"to_user":"to_user2","from_user":"test2","id":10002,"from_user_id":102,"iso_language_code":"en","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/xxx\/102.jpg","created_at":"Sat, 03 Jan 2009 12:49:09 +0000"},
4
- {"text":"texttext 1","to_user_id":101,"to_user":"to_user1","from_user":"test1","id":10001,"from_user_id":101,"iso_language_code":"en","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/xxx\/101.jpg","created_at":"Sat, 03 Jan 2009 12:49:09 +0000"},
5
- {"text":"texttext 0","to_user_id":100,"to_user":"to_user0","from_user":"test0","id":10000,"from_user_id":100,"iso_language_code":"en","profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/xxx\/100.jpg","created_at":"Sat, 03 Jan 2009 12:49:09 +0000"}
6
- ],
7
- "since_id":0,"max_id":1093328763,"refresh_url":"?since_id=1093328763&q=ruby","results_per_page":15,"next_page":"?page=2&max_id=1093328763&q=ruby","completed_in":0.019603,"page":1,"query":"ruby"
8
- }