termtter 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/README.rdoc +2 -2
- data/Rakefile +41 -75
- data/VERSION +1 -0
- data/bin/termtter +9 -2
- data/doc/Termtter-1.0-Release-Note-English.txt +37 -0
- data/doc/Termtter-1.0-Release-Note.txt +37 -0
- data/lib/plugins/another_prompt.rb +8 -8
- data/lib/plugins/ar.rb +102 -0
- data/lib/plugins/async.rb +1 -1
- data/lib/plugins/babelfish.rb +34 -0
- data/lib/plugins/confirm.rb +2 -0
- data/lib/plugins/crypt.rb +44 -0
- data/lib/plugins/defaults/auto_reload.rb +1 -1
- data/lib/plugins/defaults/command_line.rb +34 -17
- data/lib/plugins/defaults/confirm.rb +30 -0
- data/lib/plugins/defaults/hashtag.rb +1 -1
- data/lib/plugins/defaults/irb.rb +30 -0
- data/lib/plugins/defaults/keyword.rb +58 -0
- data/lib/plugins/defaults/list.rb +155 -0
- data/lib/plugins/defaults/plugin.rb +59 -0
- data/lib/plugins/defaults/retweet.rb +75 -23
- data/lib/plugins/defaults/standard_commands.rb +60 -87
- data/lib/plugins/defaults/standard_completion.rb +25 -15
- data/lib/plugins/defaults/stdout.rb +49 -10
- data/lib/plugins/defaults/switch.rb +1 -1
- data/lib/plugins/defaults/users.rb +63 -0
- data/lib/plugins/draft.rb +58 -0
- data/lib/plugins/expand-tinyurl.rb +5 -9
- data/lib/plugins/favotter.rb +1 -1
- data/lib/plugins/footer.rb +22 -0
- data/lib/plugins/friends.rb +5 -4
- data/lib/plugins/g.rb +9 -16
- data/lib/plugins/gem_install.rb +24 -0
- data/lib/plugins/gist.rb +20 -0
- data/lib/plugins/grass.rb +1 -1
- data/lib/plugins/gyazo.rb +78 -0
- data/lib/plugins/http_server.rb +1 -1
- data/lib/plugins/hugeurl.rb +6 -13
- data/lib/plugins/irc_gw.rb +15 -11
- data/lib/plugins/me.rb +1 -1
- data/lib/plugins/notify-send.rb +1 -1
- data/lib/plugins/notify-send3.rb +1 -1
- data/lib/plugins/open.rb +1 -1
- data/lib/plugins/open_url.rb +5 -1
- data/lib/plugins/pool.rb +1 -1
- data/lib/plugins/random.rb +1 -1
- data/lib/plugins/reply_retweet.rb +42 -0
- data/lib/plugins/screen-notify.rb +1 -1
- data/lib/plugins/sl.rb +3 -3
- data/lib/plugins/storage.rb +7 -10
- data/lib/plugins/storage/sqlite3.rb +155 -0
- data/lib/plugins/storage/status.rb +2 -0
- data/lib/plugins/stream.rb +1 -1
- data/lib/plugins/tinyurl.rb +3 -9
- data/lib/plugins/trends.rb +2 -2
- data/lib/plugins/truncate.rb +1 -1
- data/lib/plugins/w3mimg.rb +1 -1
- data/lib/termtter.rb +19 -20
- data/lib/termtter/active_rubytter.rb +4 -0
- data/lib/termtter/api.rb +22 -5
- data/lib/termtter/client.rb +55 -40
- data/lib/termtter/command.rb +3 -2
- data/lib/termtter/config_setup.rb +1 -1
- data/lib/termtter/config_template.erb +5 -0
- data/lib/termtter/default_config.rb +18 -0
- data/lib/termtter/hookable.rb +1 -0
- data/lib/termtter/httppool.rb +44 -0
- data/lib/termtter/memory_cache.rb +32 -0
- data/lib/termtter/optparse.rb +8 -15
- data/lib/termtter/rubytter_proxy.rb +65 -4
- data/lib/termtter/system_extensions.rb +40 -9
- data/lib/termtter/task.rb +2 -1
- data/spec/plugins/defaults/hashtag_spec.rb +8 -7
- data/spec/plugins/defaults/list_spec.rb +33 -0
- data/spec/plugins/defaults/plugin_spec.rb +17 -0
- data/spec/plugins/defaults/retweet_spec.rb +205 -0
- data/spec/plugins/draft_spec.rb +59 -0
- data/spec/plugins/expand-tinyurl_spec.rb +21 -0
- data/spec/plugins/footer_spec.rb +50 -0
- data/spec/plugins/storage/sqlite3_spec.rb +41 -0
- data/spec/termtter/api_spec.rb +1 -1
- data/spec/termtter/client_spec.rb +21 -21
- data/spec/termtter/command_spec.rb +8 -8
- data/spec/termtter/config_spec.rb +2 -2
- data/spec/termtter/memory_cache_spec.rb +20 -0
- data/spec/termtter/optparse_spec.rb +1 -1
- data/spec/termtter/rubytter_proxy_spec.rb +38 -0
- data/spec/termtter/system_extensions_spec.rb +25 -23
- data/spec/termtter/task_manager_spec.rb +1 -1
- data/spec/termtter_spec.rb +4 -2
- metadata +88 -19
- data/lib/plugins/defaults/lists.rb +0 -14
- data/lib/plugins/irb.rb +0 -6
- data/lib/plugins/storage/DB.rb +0 -37
- data/lib/termtter/version.rb +0 -4
- data/spec/plugins/defaults/lists_spec.rb +0 -34
- data/spec/plugins/storage/DB_spec_.rb +0 -12
@@ -12,32 +12,34 @@ describe Termtter do
|
|
12
12
|
|
13
13
|
it 'provides win?' do
|
14
14
|
be_quiet do
|
15
|
-
original_ruby_platform = RUBY_PLATFORM
|
16
|
-
RUBY_PLATFORM = 'darwin'
|
15
|
+
original_ruby_platform = ::RUBY_PLATFORM
|
16
|
+
::RUBY_PLATFORM = 'darwin'
|
17
17
|
win?.should == false
|
18
|
-
RUBY_PLATFORM = 'mswin'
|
18
|
+
::RUBY_PLATFORM = 'mswin'
|
19
19
|
win?.should == true
|
20
|
-
RUBY_PLATFORM = original_ruby_platform
|
20
|
+
::RUBY_PLATFORM = original_ruby_platform
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
Readline
|
26
|
-
|
27
|
-
|
24
|
+
if Readline.const_defined?(:LIBREADLINE)
|
25
|
+
it 'Readline can refresh line' do
|
26
|
+
Readline::LIBREADLINE.should_receive(:rl_refresh_line).with(0, 0)
|
27
|
+
Readline.refresh_line
|
28
|
+
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
it 'extend DL::Impoter when not be able to find DL::Importable' do
|
31
|
+
be_quiet { DL::Importer = mock(:importer) }
|
32
|
+
DL.stub(:const_defined?).with(:Importable).and_return(false)
|
33
|
+
Readline::LIBREADLINE.should_receive(:extend).with(DL::Importer)
|
34
|
+
load 'termtter/system_extensions.rb'
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
it 'can handle error when difine LIBREADLINE' do
|
38
|
+
Readline::LIBREADLINE.stub(:extend) { raise }
|
39
|
+
load 'termtter/system_extensions.rb'
|
40
|
+
Readline::LIBREADLINE.should_not_receive(:rl_refresh_line)
|
41
|
+
Readline.refresh_line
|
42
|
+
end
|
41
43
|
end
|
42
44
|
|
43
45
|
it 'can open browser that suites platform' do
|
@@ -45,13 +47,13 @@ describe Termtter do
|
|
45
47
|
url = 'example.com'
|
46
48
|
[
|
47
49
|
['linux', 'firefox'],
|
48
|
-
['mswin', '
|
49
|
-
['mingw', '
|
50
|
-
['bccwin', '
|
50
|
+
['mswin', 'start'],
|
51
|
+
['mingw', 'start'],
|
52
|
+
['bccwin', 'start'],
|
51
53
|
['darwin', 'open'],
|
52
54
|
['hogehog', 'open'],
|
53
55
|
].each do |platform, browser|
|
54
|
-
RUBY_PLATFORM = platform
|
56
|
+
::RUBY_PLATFORM = platform
|
55
57
|
self.should_receive(:system).with(browser, url)
|
56
58
|
open_browser(url)
|
57
59
|
end
|
@@ -129,7 +129,7 @@ module Termtter
|
|
129
129
|
called = false
|
130
130
|
block = lambda { called = true}
|
131
131
|
@task_manager.should_receive(:invoke_and_wait).with(&block)
|
132
|
-
@task_manager.invoke_later
|
132
|
+
@task_manager.invoke_later(&block).join
|
133
133
|
called.should be_true
|
134
134
|
end
|
135
135
|
end
|
data/spec/termtter_spec.rb
CHANGED
@@ -30,10 +30,12 @@ end
|
|
30
30
|
describe Termtter, 'when termtter is loaded' do
|
31
31
|
it 'will add load path' do
|
32
32
|
termtter_path = File.expand_path(File.dirname(__FILE__) + '/../lib/termtter.rb')
|
33
|
+
termtter_lib_path = File.dirname(termtter_path)
|
33
34
|
original_load_path = $:.dup
|
34
|
-
$:.
|
35
|
+
$:.delete(termtter_lib_path)
|
36
|
+
$:.include?(termtter_lib_path).should == false
|
35
37
|
be_quiet { load termtter_path }
|
36
|
-
$:.include?(
|
38
|
+
$:.include?(termtter_lib_path).should == true
|
37
39
|
$:.concat(original_load_path)
|
38
40
|
end
|
39
41
|
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.
|
4
|
+
version: 1.7.0
|
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:
|
13
|
+
date: 2010-01-24 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.
|
54
|
+
version: 0.11.0
|
55
55
|
version:
|
56
56
|
description: Termtter is a terminal based Twitter client.
|
57
57
|
email: jugyo.org@gmail.com
|
@@ -61,38 +61,53 @@ executables:
|
|
61
61
|
extensions: []
|
62
62
|
|
63
63
|
extra_rdoc_files:
|
64
|
-
- README.rdoc
|
65
64
|
- ChangeLog
|
66
|
-
files:
|
67
|
-
- Rakefile
|
68
65
|
- README.rdoc
|
66
|
+
files:
|
67
|
+
- .gitignore
|
69
68
|
- ChangeLog
|
69
|
+
- README.rdoc
|
70
|
+
- Rakefile
|
71
|
+
- VERSION
|
72
|
+
- bin/kill_termtter
|
73
|
+
- bin/termtter
|
74
|
+
- doc/Termtter-1.0-Release-Note-English.txt
|
75
|
+
- doc/Termtter-1.0-Release-Note.txt
|
70
76
|
- lib/plugins/addspace.rb
|
71
77
|
- lib/plugins/another_prompt.rb
|
72
78
|
- lib/plugins/april_fool.rb
|
79
|
+
- lib/plugins/ar.rb
|
73
80
|
- lib/plugins/async.rb
|
81
|
+
- lib/plugins/babelfish.rb
|
74
82
|
- lib/plugins/bomb.rb
|
75
83
|
- lib/plugins/clear.rb
|
76
84
|
- lib/plugins/command_plus.rb
|
77
85
|
- lib/plugins/confirm.rb
|
78
86
|
- lib/plugins/cool.rb
|
79
87
|
- lib/plugins/countter.rb
|
88
|
+
- lib/plugins/crypt.rb
|
80
89
|
- lib/plugins/curry.rb
|
81
90
|
- lib/plugins/db.rb
|
91
|
+
- lib/plugins/defaults.rb
|
82
92
|
- lib/plugins/defaults/alias.rb
|
83
93
|
- lib/plugins/defaults/auto_reload.rb
|
84
94
|
- lib/plugins/defaults/command_line.rb
|
95
|
+
- lib/plugins/defaults/confirm.rb
|
85
96
|
- lib/plugins/defaults/eval.rb
|
86
97
|
- lib/plugins/defaults/exec.rb
|
87
98
|
- lib/plugins/defaults/fib.rb
|
88
99
|
- lib/plugins/defaults/hashtag.rb
|
89
|
-
- lib/plugins/defaults/
|
100
|
+
- lib/plugins/defaults/irb.rb
|
101
|
+
- lib/plugins/defaults/keyword.rb
|
102
|
+
- lib/plugins/defaults/list.rb
|
103
|
+
- lib/plugins/defaults/plugin.rb
|
90
104
|
- lib/plugins/defaults/retweet.rb
|
91
105
|
- lib/plugins/defaults/standard_commands.rb
|
92
106
|
- lib/plugins/defaults/standard_completion.rb
|
93
107
|
- lib/plugins/defaults/stdout.rb
|
94
108
|
- lib/plugins/defaults/switch.rb
|
95
|
-
- lib/plugins/defaults.rb
|
109
|
+
- lib/plugins/defaults/users.rb
|
110
|
+
- lib/plugins/draft.rb
|
96
111
|
- lib/plugins/eject.rb
|
97
112
|
- lib/plugins/en2ja.rb
|
98
113
|
- lib/plugins/english.rb
|
@@ -103,8 +118,11 @@ files:
|
|
103
118
|
- lib/plugins/fib_filter.rb
|
104
119
|
- lib/plugins/fibyou.rb
|
105
120
|
- lib/plugins/filter.rb
|
121
|
+
- lib/plugins/footer.rb
|
106
122
|
- lib/plugins/friends.rb
|
107
123
|
- lib/plugins/g.rb
|
124
|
+
- lib/plugins/gem_install.rb
|
125
|
+
- lib/plugins/gist.rb
|
108
126
|
- lib/plugins/github-issues.rb
|
109
127
|
- lib/plugins/graduatter.rb
|
110
128
|
- lib/plugins/grass.rb
|
@@ -112,17 +130,17 @@ files:
|
|
112
130
|
- lib/plugins/growl.rb
|
113
131
|
- lib/plugins/growl2.rb
|
114
132
|
- lib/plugins/gsub.rb
|
133
|
+
- lib/plugins/gyazo.rb
|
115
134
|
- lib/plugins/haml.rb
|
116
135
|
- lib/plugins/hatebu.rb
|
117
136
|
- lib/plugins/hatebu_and_update.rb
|
118
137
|
- lib/plugins/hi.rb
|
119
138
|
- lib/plugins/history.rb
|
139
|
+
- lib/plugins/http_server.rb
|
120
140
|
- lib/plugins/http_server/favicon.ico
|
121
141
|
- lib/plugins/http_server/index.html
|
122
|
-
- lib/plugins/http_server.rb
|
123
142
|
- lib/plugins/hugeurl.rb
|
124
143
|
- lib/plugins/ignore.rb
|
125
|
-
- lib/plugins/irb.rb
|
126
144
|
- lib/plugins/irc_gw.rb
|
127
145
|
- lib/plugins/itunes.rb
|
128
146
|
- lib/plugins/jakigan.rb
|
@@ -162,6 +180,7 @@ files:
|
|
162
180
|
- lib/plugins/reload.rb
|
163
181
|
- lib/plugins/replace.rb
|
164
182
|
- lib/plugins/reply.rb
|
183
|
+
- lib/plugins/reply_retweet.rb
|
165
184
|
- lib/plugins/reverse.rb
|
166
185
|
- lib/plugins/say.rb
|
167
186
|
- lib/plugins/saykanji.rb
|
@@ -174,10 +193,10 @@ files:
|
|
174
193
|
- lib/plugins/sl.rb
|
175
194
|
- lib/plugins/source.rb
|
176
195
|
- lib/plugins/spam.rb
|
177
|
-
- lib/plugins/storage
|
196
|
+
- lib/plugins/storage.rb
|
197
|
+
- lib/plugins/storage/sqlite3.rb
|
178
198
|
- lib/plugins/storage/status.rb
|
179
199
|
- lib/plugins/storage/status_mook.rb
|
180
|
-
- lib/plugins/storage.rb
|
181
200
|
- lib/plugins/stream.rb
|
182
201
|
- lib/plugins/switch_user.rb
|
183
202
|
- lib/plugins/system_status.rb
|
@@ -198,6 +217,7 @@ files:
|
|
198
217
|
- lib/plugins/yhara.rb
|
199
218
|
- lib/plugins/yhara_filter.rb
|
200
219
|
- lib/plugins/yonda.rb
|
220
|
+
- lib/termtter.rb
|
201
221
|
- lib/termtter/active_rubytter.rb
|
202
222
|
- lib/termtter/api.rb
|
203
223
|
- lib/termtter/client.rb
|
@@ -205,26 +225,32 @@ files:
|
|
205
225
|
- lib/termtter/config.rb
|
206
226
|
- lib/termtter/config_setup.rb
|
207
227
|
- lib/termtter/config_template.erb
|
228
|
+
- lib/termtter/default_config.rb
|
208
229
|
- lib/termtter/hook.rb
|
209
230
|
- lib/termtter/hookable.rb
|
231
|
+
- lib/termtter/httppool.rb
|
232
|
+
- lib/termtter/memory_cache.rb
|
210
233
|
- lib/termtter/optparse.rb
|
211
234
|
- lib/termtter/rubytter_proxy.rb
|
235
|
+
- lib/termtter/system_extensions.rb
|
212
236
|
- lib/termtter/system_extensions/core_compatibles.rb
|
213
237
|
- lib/termtter/system_extensions/termtter_compatibles.rb
|
214
238
|
- lib/termtter/system_extensions/windows.rb
|
215
|
-
- lib/termtter/system_extensions.rb
|
216
239
|
- lib/termtter/task.rb
|
217
240
|
- lib/termtter/task_manager.rb
|
218
|
-
- lib/termtter/version.rb
|
219
|
-
- lib/termtter.rb
|
220
241
|
- spec/plugins/cool_spec.rb
|
221
242
|
- spec/plugins/curry_spec.rb
|
222
243
|
- spec/plugins/db_spec.rb
|
223
244
|
- spec/plugins/defaults/hashtag_spec.rb
|
224
|
-
- spec/plugins/defaults/
|
245
|
+
- spec/plugins/defaults/list_spec.rb
|
246
|
+
- spec/plugins/defaults/plugin_spec.rb
|
247
|
+
- spec/plugins/defaults/retweet_spec.rb
|
248
|
+
- spec/plugins/draft_spec.rb
|
225
249
|
- spec/plugins/english_spec_.rb
|
250
|
+
- spec/plugins/expand-tinyurl_spec.rb
|
226
251
|
- spec/plugins/fib_spec.rb
|
227
252
|
- spec/plugins/filter_spec_.rb
|
253
|
+
- spec/plugins/footer_spec.rb
|
228
254
|
- spec/plugins/gsub_spec.rb
|
229
255
|
- spec/plugins/haml_spec.rb
|
230
256
|
- spec/plugins/md5pass_spec.rb
|
@@ -234,7 +260,7 @@ files:
|
|
234
260
|
- spec/plugins/sl_spec_.rb
|
235
261
|
- spec/plugins/spam_spec.rb
|
236
262
|
- spec/plugins/standard_commands_spec.rb
|
237
|
-
- spec/plugins/storage/
|
263
|
+
- spec/plugins/storage/sqlite3_spec.rb
|
238
264
|
- spec/plugins/storage/status_spec_.rb
|
239
265
|
- spec/plugins/truncate_spec.rb
|
240
266
|
- spec/plugins/whois_spec_.rb
|
@@ -247,6 +273,7 @@ files:
|
|
247
273
|
- spec/termtter/config_spec.rb
|
248
274
|
- spec/termtter/hook_spec.rb
|
249
275
|
- spec/termtter/hookable_spec.rb
|
276
|
+
- spec/termtter/memory_cache_spec.rb
|
250
277
|
- spec/termtter/optparse_spec.rb
|
251
278
|
- spec/termtter/rubytter_proxy_spec.rb
|
252
279
|
- spec/termtter/system_extensions/windows_spec.rb
|
@@ -287,5 +314,47 @@ rubygems_version: 1.3.5
|
|
287
314
|
signing_key:
|
288
315
|
specification_version: 3
|
289
316
|
summary: Terminal based Twitter client.
|
290
|
-
test_files:
|
291
|
-
|
317
|
+
test_files:
|
318
|
+
- spec/plugins/cool_spec.rb
|
319
|
+
- spec/plugins/curry_spec.rb
|
320
|
+
- spec/plugins/db_spec.rb
|
321
|
+
- spec/plugins/defaults/hashtag_spec.rb
|
322
|
+
- spec/plugins/defaults/list_spec.rb
|
323
|
+
- spec/plugins/defaults/plugin_spec.rb
|
324
|
+
- spec/plugins/defaults/retweet_spec.rb
|
325
|
+
- spec/plugins/draft_spec.rb
|
326
|
+
- spec/plugins/english_spec_.rb
|
327
|
+
- spec/plugins/expand-tinyurl_spec.rb
|
328
|
+
- spec/plugins/fib_spec.rb
|
329
|
+
- spec/plugins/filter_spec_.rb
|
330
|
+
- spec/plugins/footer_spec.rb
|
331
|
+
- spec/plugins/gsub_spec.rb
|
332
|
+
- spec/plugins/haml_spec.rb
|
333
|
+
- spec/plugins/md5pass_spec.rb
|
334
|
+
- spec/plugins/pause_spec.rb
|
335
|
+
- spec/plugins/primes_spec_.rb
|
336
|
+
- spec/plugins/shell_spec.rb
|
337
|
+
- spec/plugins/sl_spec_.rb
|
338
|
+
- spec/plugins/spam_spec.rb
|
339
|
+
- spec/plugins/standard_commands_spec.rb
|
340
|
+
- spec/plugins/storage/sqlite3_spec.rb
|
341
|
+
- spec/plugins/storage/status_spec_.rb
|
342
|
+
- spec/plugins/truncate_spec.rb
|
343
|
+
- spec/plugins/whois_spec_.rb
|
344
|
+
- spec/spec_helper.rb
|
345
|
+
- spec/termtter/active_rubytter_spec.rb
|
346
|
+
- spec/termtter/api_spec.rb
|
347
|
+
- spec/termtter/client_spec.rb
|
348
|
+
- spec/termtter/command_spec.rb
|
349
|
+
- spec/termtter/config_setup_spec.rb
|
350
|
+
- spec/termtter/config_spec.rb
|
351
|
+
- spec/termtter/hook_spec.rb
|
352
|
+
- spec/termtter/hookable_spec.rb
|
353
|
+
- spec/termtter/memory_cache_spec.rb
|
354
|
+
- spec/termtter/optparse_spec.rb
|
355
|
+
- spec/termtter/rubytter_proxy_spec.rb
|
356
|
+
- spec/termtter/system_extensions/windows_spec.rb
|
357
|
+
- spec/termtter/system_extensions_spec.rb
|
358
|
+
- spec/termtter/task_manager_spec.rb
|
359
|
+
- spec/termtter/task_spec.rb
|
360
|
+
- spec/termtter_spec.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Termtter::Client
|
2
|
-
register_command(
|
3
|
-
:name => :lists,
|
4
|
-
:exec => lambda {|arg|
|
5
|
-
unless arg.empty?
|
6
|
-
user_name = normalize_as_user_name(arg)
|
7
|
-
else
|
8
|
-
user_name = config.user_name
|
9
|
-
end
|
10
|
-
# TODO: show more information of lists
|
11
|
-
puts Termtter::API.twitter.lists(user_name).lists.map{|i| i.slug}
|
12
|
-
}
|
13
|
-
)
|
14
|
-
end
|
data/lib/plugins/irb.rb
DELETED
data/lib/plugins/storage/DB.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'sqlite3'
|
4
|
-
require 'singleton'
|
5
|
-
|
6
|
-
module Termtter::Storage
|
7
|
-
class DB
|
8
|
-
include Singleton
|
9
|
-
attr_reader :db
|
10
|
-
|
11
|
-
def initialize
|
12
|
-
@db = SQLite3::Database.new(Termtter::CONF_DIR + '/storage.db')
|
13
|
-
@db.type_translation = true
|
14
|
-
create_table
|
15
|
-
end
|
16
|
-
|
17
|
-
def create_table
|
18
|
-
sql =<<-SQL
|
19
|
-
CREATE TABLE IF NOT EXISTS user (
|
20
|
-
id int NOT NULL,
|
21
|
-
screen_name text,
|
22
|
-
PRIMARY KEY (id)
|
23
|
-
);
|
24
|
-
CREATE TABLE IF NOT EXISTS post (
|
25
|
-
post_id int NOT NULL, -- twitter側のpostのid
|
26
|
-
created_at int, -- 日付(RubyでUNIX時間に変換)
|
27
|
-
in_reply_to_status_id int, -- あったほうがよいらしい
|
28
|
-
in_reply_to_user_id int, -- あったほうがよいらしい
|
29
|
-
post_text text,
|
30
|
-
user_id int NOT NULL,
|
31
|
-
PRIMARY KEY (post_id)
|
32
|
-
);
|
33
|
-
SQL
|
34
|
-
@db.execute_batch(sql)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/termtter/version.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
-
|
3
|
-
describe 'plugin lists' do
|
4
|
-
before do
|
5
|
-
config.user_name = 'jugyo'
|
6
|
-
@twitter_stub = Object.new
|
7
|
-
Termtter::API.stub!(:twitter).and_return(@twitter_stub)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe 'command lists' do
|
11
|
-
before do
|
12
|
-
Termtter::Client.plug 'defaults'
|
13
|
-
@command = Termtter::Client.commands[:lists]
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'command name is :lists' do
|
17
|
-
@command.name.should == :lists
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should call with no user_name' do
|
21
|
-
response = Object.new
|
22
|
-
response.stub!(:lists).and_return({})
|
23
|
-
@twitter_stub.should_receive(:lists).with('jugyo').and_return(response)
|
24
|
-
Termtter::Client.call_commands('lists')
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should call with user_name' do
|
28
|
-
response = Object.new
|
29
|
-
response.stub!(:lists).and_return({})
|
30
|
-
@twitter_stub.should_receive(:lists).with('termtter').and_return(response)
|
31
|
-
Termtter::Client.call_commands('lists termtter')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|