jugyo-termtter 0.8.14 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +8 -8
- data/Rakefile +3 -5
- data/lib/{plugin → plugins}/april_fool.rb +0 -0
- data/lib/plugins/bomb.rb +42 -0
- data/lib/{plugin → plugins}/clear.rb +0 -0
- data/lib/{plugin → plugins}/confirm.rb +0 -0
- data/lib/{plugin → plugins}/cool.rb +0 -0
- data/lib/{plugin → plugins}/devel.rb +0 -0
- data/lib/{filter → plugins}/en2ja.rb +1 -1
- data/lib/plugins/english.rb +25 -0
- data/lib/{plugin → plugins}/erb.rb +0 -0
- data/lib/{filter → plugins}/expand-tinyurl.rb +6 -6
- data/lib/plugins/favorite.rb +63 -0
- data/lib/plugins/fib.rb +28 -0
- data/lib/{filter/fib.rb → plugins/fib_filter.rb} +1 -2
- data/lib/{plugin → plugins}/filter.rb +0 -0
- data/lib/{plugin → plugins}/graduatter.rb +1 -2
- data/lib/{plugin → plugins}/grass.rb +2 -2
- data/lib/{plugin → plugins}/group.rb +9 -9
- data/lib/{plugin → plugins}/growl.rb +11 -12
- data/lib/{plugin → plugins}/hatebu.rb +5 -5
- data/lib/{plugin → plugins}/history.rb +13 -13
- data/lib/plugins/ignore.rb +19 -0
- data/lib/plugins/keyword.rb +18 -0
- data/lib/{plugin → plugins}/log.rb +18 -12
- data/lib/{plugin → plugins}/me.rb +1 -2
- data/lib/{plugin → plugins}/modify_arg_hook_sample.rb +0 -0
- data/lib/{plugin → plugins}/msagent.rb +1 -1
- data/lib/plugins/multi_reply.rb +27 -0
- data/lib/{plugin → plugins}/notify-send.rb +1 -1
- data/lib/{plugin → plugins}/otsune.rb +0 -0
- data/lib/plugins/outputz.rb +33 -0
- data/lib/{plugin → plugins}/pause.rb +0 -0
- data/lib/{plugin → plugins}/plugin.rb +0 -0
- data/lib/{plugin → plugins}/post_exec_hook_sample.rb +0 -0
- data/lib/{plugin → plugins}/pre_exec_hook_sample.rb +0 -0
- data/lib/{plugin → plugins}/primes.rb +9 -2
- data/lib/plugins/quicklook.rb +41 -0
- data/lib/{plugin → plugins}/random.rb +0 -0
- data/lib/{plugin → plugins}/reblog.rb +3 -3
- data/lib/{plugin → plugins}/reload.rb +0 -0
- data/lib/{filter → plugins}/reply.rb +0 -0
- data/lib/{filter → plugins}/reverse.rb +1 -1
- data/lib/{plugin → plugins}/say.rb +1 -1
- data/lib/{plugin → plugins}/scrape.rb +4 -4
- data/lib/plugins/screen-notify.rb +13 -0
- data/lib/plugins/screen.rb +24 -0
- data/lib/{plugin → plugins}/shell.rb +0 -0
- data/lib/{plugin → plugins}/sl.rb +4 -4
- data/lib/plugins/spam.rb +13 -0
- data/lib/{plugin → plugins}/standard_plugins.rb +72 -18
- data/lib/plugins/stdout.rb +80 -0
- data/lib/plugins/storage/DB.rb +37 -0
- data/lib/plugins/storage/status.rb +48 -0
- data/lib/plugins/storage/status_mook.rb +30 -0
- data/lib/plugins/storage.rb +47 -0
- data/lib/plugins/system_status.rb +33 -0
- data/lib/{plugin → plugins}/translation.rb +15 -5
- data/lib/{plugin → plugins}/update_editor.rb +6 -6
- data/lib/plugins/uri-open.rb +64 -0
- data/lib/{filter → plugins}/url_addspace.rb +0 -0
- data/lib/{plugin → plugins}/wassr_post.rb +1 -1
- data/lib/{plugin → plugins}/yhara.rb +1 -1
- data/lib/plugins/yhara_filter.rb +8 -0
- data/lib/plugins/yonda.rb +21 -0
- data/lib/termtter/api.rb +28 -2
- data/lib/termtter/client.rb +90 -102
- data/lib/termtter/command.rb +32 -31
- data/lib/termtter/config.rb +64 -0
- data/lib/termtter/connection.rb +9 -7
- data/lib/termtter/hook.rb +11 -2
- data/lib/termtter/optparse.rb +14 -0
- data/lib/termtter/version.rb +1 -1
- data/lib/termtter.rb +19 -22
- data/spec/plugin/english_spec.rb +19 -0
- data/spec/plugin/favorite_spec.rb +10 -0
- data/spec/plugin/fib_spec.rb +1 -2
- data/spec/plugin/pause_spec.rb +8 -0
- data/spec/plugin/plugin_spec.rb +1 -1
- data/spec/plugin/primes_spec.rb +15 -0
- data/spec/plugin/sl_spec.rb +8 -0
- data/spec/plugin/spam_spec.rb +0 -13
- data/spec/plugin/standard_plugins_spec.rb +0 -7
- data/spec/plugin/storage/DB_spec.rb +12 -0
- data/spec/plugin/storage/status_spec.rb +24 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/termtter/client_spec.rb +63 -1
- data/spec/termtter/command_spec.rb +6 -68
- data/spec/termtter/config_spec.rb +111 -0
- data/spec/termtter/hook_spec.rb +69 -0
- data/spec/termtter_spec.rb +22 -34
- metadata +81 -72
- data/lib/filter/english.rb +0 -8
- data/lib/filter/ignore.rb +0 -19
- data/lib/filter/yhara.rb +0 -20
- data/lib/plugin/bomb.rb +0 -29
- data/lib/plugin/english.rb +0 -59
- data/lib/plugin/favorite.rb +0 -75
- data/lib/plugin/fib.rb +0 -8
- data/lib/plugin/follow.rb +0 -60
- data/lib/plugin/keyword.rb +0 -18
- data/lib/plugin/multi_reply.rb +0 -36
- data/lib/plugin/outputz.rb +0 -35
- data/lib/plugin/quicklook.rb +0 -38
- data/lib/plugin/screen.rb +0 -24
- data/lib/plugin/spam.rb +0 -9
- data/lib/plugin/stdout.rb +0 -63
- data/lib/plugin/system_status.rb +0 -33
- data/lib/plugin/uri-open.rb +0 -69
- data/lib/plugin/yonda.rb +0 -20
- data/lib/termtter/status.rb +0 -26
- data/lib/termtter/twitter.rb +0 -188
- data/lib/termtter/user.rb +0 -13
- data/spec/termtter/user_spec.rb +0 -27
- data/test/test_termtter.rb +0 -86
@@ -17,22 +17,6 @@ module Termtter
|
|
17
17
|
@command = Command.new(params)
|
18
18
|
end
|
19
19
|
|
20
|
-
it 'should execute' do
|
21
|
-
[
|
22
|
-
['update test test', 'test test'],
|
23
|
-
['update test test', 'test test'],
|
24
|
-
['update test test', 'test test'],
|
25
|
-
].each do |input, args|
|
26
|
-
result = @command.exec_if_match(input)
|
27
|
-
result.should == args
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should failed on execute' do
|
32
|
-
result = @command.exec_if_match('upda test test')
|
33
|
-
result.should == nil
|
34
|
-
end
|
35
|
-
|
36
20
|
it 'should return command regex' do
|
37
21
|
@command.pattern.should == /^((update|u|up)|(update|u|up)\s+(.*?))\s*$/
|
38
22
|
end
|
@@ -64,46 +48,28 @@ module Termtter
|
|
64
48
|
['upd', ['update']],
|
65
49
|
[' upd', []],
|
66
50
|
[' upd ', []],
|
67
|
-
['update', ['complete1', 'complete2']],
|
68
|
-
['update ', ['complete1', 'complete2']],
|
51
|
+
['update a', ['complete1', 'complete2']],
|
69
52
|
[' update ', []],
|
70
53
|
['u foo', ['complete1', 'complete2']],
|
71
|
-
['u', ['complete1', 'complete2']],
|
72
|
-
['up', ['complete1', 'complete2']],
|
73
54
|
].each do |input, comp|
|
74
55
|
@command.complement(input).should == comp
|
75
56
|
end
|
76
57
|
end
|
77
58
|
|
78
|
-
it 'should can redefine exec_proc' do
|
79
|
-
# redefine exec_proc
|
80
|
-
command_arg = nil
|
81
|
-
@command.exec_proc = lambda {|arg|
|
82
|
-
command_arg = arg
|
83
|
-
'result'
|
84
|
-
}
|
85
|
-
command_arg.should == nil
|
86
|
-
|
87
|
-
# exec command
|
88
|
-
result = @command.exec_if_match('update test test')
|
89
|
-
command_arg.should == 'test test'
|
90
|
-
result.should == 'result'
|
91
|
-
end
|
92
|
-
|
93
59
|
it 'should return command_info when call method "match?"' do
|
94
60
|
[
|
95
61
|
['update', ['update', nil]],
|
96
62
|
['up', ['up', nil]],
|
97
63
|
['u', ['u', nil]],
|
98
64
|
['update ', ['update', nil]],
|
99
|
-
[' update ', nil],
|
65
|
+
[' update ', [nil, nil]],
|
100
66
|
['update foo', ['update', 'foo']],
|
101
|
-
[' update foo', nil],
|
102
|
-
[' update foo ', nil],
|
67
|
+
[' update foo', [nil, nil]],
|
68
|
+
[' update foo ', [nil, nil]],
|
103
69
|
['u foo', ['u', 'foo']],
|
104
70
|
['up foo', ['up', 'foo']],
|
105
|
-
['upd foo', nil],
|
106
|
-
['upd foo', nil],
|
71
|
+
['upd foo', [nil, nil]],
|
72
|
+
['upd foo', [nil, nil]],
|
107
73
|
].each do |input, result|
|
108
74
|
@command.match?(input).should == result
|
109
75
|
end
|
@@ -115,11 +81,6 @@ module Termtter
|
|
115
81
|
lambda { Command.new(:aliases => ['u']) }.should raise_error(ArgumentError)
|
116
82
|
end
|
117
83
|
|
118
|
-
it 'should return true with the exec_proc return nil' do
|
119
|
-
command = Command.new(:name => :test, :exec_proc => lambda {|args|})
|
120
|
-
command.exec_if_match('test').should == true
|
121
|
-
end
|
122
|
-
|
123
84
|
it 'should call exec_proc when call method "execute"' do
|
124
85
|
@command.execute('test').should == 'test'
|
125
86
|
@command.execute(' test').should == ' test'
|
@@ -127,29 +88,6 @@ module Termtter
|
|
127
88
|
@command.execute('test test').should == 'test test'
|
128
89
|
end
|
129
90
|
|
130
|
-
it 'should redefine method "exec_if_match"' do
|
131
|
-
# add method
|
132
|
-
class << @command
|
133
|
-
def exec_if_match(input)
|
134
|
-
case input
|
135
|
-
when /^update\s+foo\s*(.*)/
|
136
|
-
foo($1)
|
137
|
-
when /^update\s+bar\s*(.*)/
|
138
|
-
bar($1)
|
139
|
-
end
|
140
|
-
end
|
141
|
-
def foo(arg)
|
142
|
-
"foo(#{arg})"
|
143
|
-
end
|
144
|
-
def bar(arg)
|
145
|
-
"bar(#{arg})"
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
@command.exec_if_match('update foo xxx').should == 'foo(xxx)'
|
150
|
-
@command.exec_if_match('update bar xxx').should == 'bar(xxx)'
|
151
|
-
end
|
152
|
-
|
153
91
|
it 'should raise ArgumentError at execute' do
|
154
92
|
lambda { @command.execute(nil) }.should_not raise_error(ArgumentError)
|
155
93
|
lambda { @command.execute('foo') }.should_not raise_error(ArgumentError)
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
4
|
+
|
5
|
+
module Termtter
|
6
|
+
describe Config do
|
7
|
+
before do
|
8
|
+
@config = Config.new
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should be able to store value to new storage' do
|
12
|
+
@config.new_storage = :value
|
13
|
+
@config.new_storage.should == :value
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should be able to make subb.key and store value' do
|
17
|
+
@config.subb.key = :value
|
18
|
+
@config.subb.key.should == :value
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should be able to make multiple storage' do
|
22
|
+
@config.subb.more.for.test = 'value'
|
23
|
+
@config.subb.more.for.test.should == 'value'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should be able to change value in storage' do
|
27
|
+
@config.storage = :value1
|
28
|
+
@config.storage = :value2
|
29
|
+
@config.storage.should == :value2
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should be able to store any data' do
|
33
|
+
[
|
34
|
+
['string', 'value' ],
|
35
|
+
['symbol', :value ],
|
36
|
+
['arrry', [:a, :b] ],
|
37
|
+
['hashes', {:a => :b}],
|
38
|
+
['integer', 1 ],
|
39
|
+
['float', 1.5 ],
|
40
|
+
['regexp', /regexp/ ],
|
41
|
+
].each do |type, value|
|
42
|
+
@config.__send__("#{type}=", value)
|
43
|
+
@config.__send__(type).should == value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should raise error when add by prohibited name' do
|
48
|
+
lambda {
|
49
|
+
@config.set_default('sub.aaa', :value)
|
50
|
+
@config.sub.aaa
|
51
|
+
}.should raise_error
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should raise error when add subb-storage to existed key' do
|
55
|
+
@config.subb = 'original value'
|
56
|
+
lambda {
|
57
|
+
@config.subb.key = 'invalid subbstitution'
|
58
|
+
}.should raise_error(
|
59
|
+
NoMethodError,
|
60
|
+
%r[undefined method `key=' for "original value":String]
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should set intermediate defult configs' do
|
65
|
+
@config.set_default 'subb.more', 'value'
|
66
|
+
@config.subb.class.should == Config
|
67
|
+
@config.subb.more.should == 'value'
|
68
|
+
|
69
|
+
@config.proxy.set_default(:port, 'value')
|
70
|
+
@config.proxy.port.should == 'value'
|
71
|
+
end
|
72
|
+
|
73
|
+
# FIXME: not work
|
74
|
+
# it 'should have :undefined value in un-assigned key' do
|
75
|
+
# @config.aaaa.should == :undefined
|
76
|
+
# end
|
77
|
+
|
78
|
+
it 'should be empty when something is assigned' do
|
79
|
+
@config.empty?.should be_true
|
80
|
+
|
81
|
+
@config.aaa = 1
|
82
|
+
@config.empty?.should be_false
|
83
|
+
|
84
|
+
@config.bbb.empty?.should be_true
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'should be empty when assigned nil' do
|
88
|
+
@config.bbb = nil
|
89
|
+
@config.empty?.should be_false
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'should be empty when set_defaulted' do
|
93
|
+
@config.set_default('aaa', 1)
|
94
|
+
@config.empty?.should be_false
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'should use in expression' do
|
98
|
+
@config.set_default(:ssb, 'hoge')
|
99
|
+
lambda {
|
100
|
+
res = @config.ssb + ' piyo'
|
101
|
+
res.should == 'hoge piyo'
|
102
|
+
}.should_not raise_error
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'should not change value when call set_default twice' do
|
106
|
+
@config.plugins.set_default :only, 'before_value'
|
107
|
+
@config.plugins.set_default :only, 'after_value'
|
108
|
+
@config.plugins.only.should == 'before_value'
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
4
|
+
|
5
|
+
module Termtter
|
6
|
+
describe Hook do
|
7
|
+
before do
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should match' do
|
11
|
+
hook = Hook.new(
|
12
|
+
:name => :span,
|
13
|
+
:points => ['foo'],
|
14
|
+
:exec_proc => lambda{|cmd, arg|
|
15
|
+
puts 'a'
|
16
|
+
}
|
17
|
+
)
|
18
|
+
hook.match?('foo').should == true
|
19
|
+
hook.match?('bar').should == false
|
20
|
+
hook.match?(:foo).should == true
|
21
|
+
hook.match?(:bar).should == false
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should match when multi points' do
|
25
|
+
hook = Hook.new(
|
26
|
+
:name => :span,
|
27
|
+
:points => ['foo', 'bar'],
|
28
|
+
:exec_proc => lambda{|cmd, arg|
|
29
|
+
puts 'a'
|
30
|
+
}
|
31
|
+
)
|
32
|
+
hook.match?('foo').should == true
|
33
|
+
hook.match?('bar').should == true
|
34
|
+
hook.match?(:foo).should == true
|
35
|
+
hook.match?(:bar).should == true
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should match when multi points' do
|
39
|
+
hook = Hook.new(
|
40
|
+
:name => :span,
|
41
|
+
:points => ['foo', /bar/],
|
42
|
+
:exec_proc => lambda{|cmd, arg|
|
43
|
+
puts 'a'
|
44
|
+
}
|
45
|
+
)
|
46
|
+
hook.match?('foo').should == true
|
47
|
+
hook.match?('bar').should == true
|
48
|
+
hook.match?('_bar_').should == true
|
49
|
+
hook.match?(:foo).should == true
|
50
|
+
hook.match?(:_bar_).should == true
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should match when multi points' do
|
54
|
+
hook = Hook.new(
|
55
|
+
:name => :span,
|
56
|
+
:points => ['foo', /^bar/],
|
57
|
+
:exec_proc => lambda{|cmd, arg|
|
58
|
+
puts 'a'
|
59
|
+
}
|
60
|
+
)
|
61
|
+
hook.match?('bar').should == true
|
62
|
+
hook.match?('bar_').should == true
|
63
|
+
hook.match?('_bar_').should == false
|
64
|
+
hook.match?(:'bar').should == true
|
65
|
+
hook.match?(:'bar_').should == true
|
66
|
+
hook.match?(:'_bar_').should == false
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
data/spec/termtter_spec.rb
CHANGED
@@ -2,42 +2,30 @@
|
|
2
2
|
|
3
3
|
require File.dirname(__FILE__) + '/spec_helper'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
describe Termtter, 'when plugin is called (without init option)' do
|
6
|
+
it 'should require global plugin if exist' do
|
7
|
+
File.should_receive(:exist?).and_return(false)
|
8
|
+
should_receive(:require).with('plugins/aaa')
|
9
|
+
plugin 'aaa'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should require user plugin if not exist' do
|
13
|
+
File.should_receive(:exist?).and_return(true)
|
14
|
+
should_receive(:require).with(File.expand_path('~/.termtter/plugins/aaa'))
|
15
|
+
plugin 'aaa'
|
16
|
+
end
|
10
17
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
it 'should handle_error if there are no plugins in global or user' do
|
19
|
+
Termtter::Client.should_receive(:handle_error)
|
20
|
+
plugin 'not-exist-plugin-hehehehehehe'
|
21
|
+
end
|
22
|
+
end
|
16
23
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
File.open(
|
21
|
-
File.dirname(__FILE__) + "/../test/friends_timeline.json"))
|
22
|
-
statuses = @twitter.get_timeline('')
|
23
|
-
statuses.size.should == 3
|
24
|
-
statuses[0].user_id.should == 102
|
25
|
-
statuses[0].user_screen_name.should == 'test2'
|
26
|
-
statuses[0].user_name.should == 'Test User 2'
|
27
|
-
statuses[0].text.should == 'texttext 2'
|
28
|
-
statuses[0].user_url.should == 'http://twitter.com/test2'
|
29
|
-
statuses[0].user_profile_image_url.should ==
|
30
|
-
'http://s3.amazonaws.com/twitter_production/profile_images/000/102.png'
|
31
|
-
statuses[0].created_at.to_s.should == 'Sat Jan 03 21:13:45 +0900 2009'
|
24
|
+
describe Termtter, 'when plugin is called (with init option)' do
|
25
|
+
it 'init option will become config' do
|
26
|
+
should_receive(:require)
|
32
27
|
|
33
|
-
|
34
|
-
|
35
|
-
statuses[2].user_name.should == 'Test User 0'
|
36
|
-
statuses[2].text.should == 'texttext 0'
|
37
|
-
statuses[2].user_url.should == 'http://twitter.com/test0'
|
38
|
-
statuses[2].user_profile_image_url.should ==
|
39
|
-
'http://s3.amazonaws.com/twitter_production/profile_images/000/100.png'
|
40
|
-
statuses[2].created_at.to_s.should == 'Sat Jan 03 21:13:45 +0900 2009'
|
41
|
-
end
|
28
|
+
plugin 'aaa', :bbb => :ccc
|
29
|
+
config.plugins.aaa.bbb.should == :ccc
|
42
30
|
end
|
43
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jugyo-termtter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jugyo
|
@@ -24,34 +24,34 @@ dependencies:
|
|
24
24
|
version: 1.1.3
|
25
25
|
version:
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
27
|
+
name: highline
|
28
28
|
type: :runtime
|
29
29
|
version_requirement:
|
30
30
|
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 1.5.0
|
35
35
|
version:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
37
|
+
name: termcolor
|
38
38
|
type: :runtime
|
39
39
|
version_requirement:
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
44
|
+
version: 0.3.1
|
45
45
|
version:
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: rubytter
|
48
48
|
type: :runtime
|
49
49
|
version_requirement:
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.4.8
|
55
55
|
version:
|
56
56
|
description: Termtter is a terminal based Twitter client
|
57
57
|
email: jugyo.org@gmail.com
|
@@ -64,94 +64,103 @@ extra_rdoc_files:
|
|
64
64
|
- README.rdoc
|
65
65
|
- History.txt
|
66
66
|
files:
|
67
|
-
- lib/
|
68
|
-
- lib/
|
69
|
-
- lib/
|
70
|
-
- lib/
|
71
|
-
- lib/
|
72
|
-
- lib/
|
73
|
-
- lib/
|
74
|
-
- lib/
|
75
|
-
- lib/
|
76
|
-
- lib/
|
77
|
-
- lib/
|
78
|
-
- lib/
|
79
|
-
- lib/
|
80
|
-
- lib/
|
81
|
-
- lib/
|
82
|
-
- lib/
|
83
|
-
- lib/
|
84
|
-
- lib/
|
85
|
-
- lib/
|
86
|
-
- lib/
|
87
|
-
- lib/
|
88
|
-
- lib/
|
89
|
-
- lib/
|
90
|
-
- lib/
|
91
|
-
- lib/
|
92
|
-
- lib/
|
93
|
-
- lib/
|
94
|
-
- lib/
|
95
|
-
- lib/
|
96
|
-
- lib/
|
97
|
-
- lib/
|
98
|
-
- lib/plugin
|
99
|
-
- lib/
|
100
|
-
- lib/
|
101
|
-
- lib/
|
102
|
-
- lib/
|
103
|
-
- lib/
|
104
|
-
- lib/
|
105
|
-
- lib/
|
106
|
-
- lib/
|
107
|
-
- lib/
|
108
|
-
- lib/
|
109
|
-
- lib/
|
110
|
-
- lib/
|
111
|
-
- lib/
|
112
|
-
- lib/
|
113
|
-
- lib/
|
114
|
-
- lib/
|
115
|
-
- lib/
|
116
|
-
- lib/
|
117
|
-
- lib/
|
118
|
-
- lib/
|
119
|
-
- lib/
|
120
|
-
- lib/
|
121
|
-
- lib/
|
122
|
-
- lib/
|
123
|
-
- lib/
|
124
|
-
- lib/
|
125
|
-
- lib/
|
126
|
-
- lib/
|
67
|
+
- lib/plugins/april_fool.rb
|
68
|
+
- lib/plugins/bomb.rb
|
69
|
+
- lib/plugins/clear.rb
|
70
|
+
- lib/plugins/confirm.rb
|
71
|
+
- lib/plugins/cool.rb
|
72
|
+
- lib/plugins/devel.rb
|
73
|
+
- lib/plugins/en2ja.rb
|
74
|
+
- lib/plugins/english.rb
|
75
|
+
- lib/plugins/erb.rb
|
76
|
+
- lib/plugins/expand-tinyurl.rb
|
77
|
+
- lib/plugins/favorite.rb
|
78
|
+
- lib/plugins/fib.rb
|
79
|
+
- lib/plugins/fib_filter.rb
|
80
|
+
- lib/plugins/filter.rb
|
81
|
+
- lib/plugins/graduatter.rb
|
82
|
+
- lib/plugins/grass.rb
|
83
|
+
- lib/plugins/group.rb
|
84
|
+
- lib/plugins/growl.rb
|
85
|
+
- lib/plugins/hatebu.rb
|
86
|
+
- lib/plugins/history.rb
|
87
|
+
- lib/plugins/ignore.rb
|
88
|
+
- lib/plugins/keyword.rb
|
89
|
+
- lib/plugins/log.rb
|
90
|
+
- lib/plugins/me.rb
|
91
|
+
- lib/plugins/modify_arg_hook_sample.rb
|
92
|
+
- lib/plugins/msagent.rb
|
93
|
+
- lib/plugins/multi_reply.rb
|
94
|
+
- lib/plugins/notify-send.rb
|
95
|
+
- lib/plugins/otsune.rb
|
96
|
+
- lib/plugins/outputz.rb
|
97
|
+
- lib/plugins/pause.rb
|
98
|
+
- lib/plugins/plugin.rb
|
99
|
+
- lib/plugins/post_exec_hook_sample.rb
|
100
|
+
- lib/plugins/pre_exec_hook_sample.rb
|
101
|
+
- lib/plugins/primes.rb
|
102
|
+
- lib/plugins/quicklook.rb
|
103
|
+
- lib/plugins/random.rb
|
104
|
+
- lib/plugins/reblog.rb
|
105
|
+
- lib/plugins/reload.rb
|
106
|
+
- lib/plugins/reply.rb
|
107
|
+
- lib/plugins/reverse.rb
|
108
|
+
- lib/plugins/say.rb
|
109
|
+
- lib/plugins/scrape.rb
|
110
|
+
- lib/plugins/screen-notify.rb
|
111
|
+
- lib/plugins/screen.rb
|
112
|
+
- lib/plugins/shell.rb
|
113
|
+
- lib/plugins/sl.rb
|
114
|
+
- lib/plugins/spam.rb
|
115
|
+
- lib/plugins/standard_plugins.rb
|
116
|
+
- lib/plugins/stdout.rb
|
117
|
+
- lib/plugins/storage/DB.rb
|
118
|
+
- lib/plugins/storage/status.rb
|
119
|
+
- lib/plugins/storage/status_mook.rb
|
120
|
+
- lib/plugins/storage.rb
|
121
|
+
- lib/plugins/system_status.rb
|
122
|
+
- lib/plugins/translation.rb
|
123
|
+
- lib/plugins/update_editor.rb
|
124
|
+
- lib/plugins/uri-open.rb
|
125
|
+
- lib/plugins/url_addspace.rb
|
126
|
+
- lib/plugins/wassr_post.rb
|
127
|
+
- lib/plugins/yhara.rb
|
128
|
+
- lib/plugins/yhara_filter.rb
|
129
|
+
- lib/plugins/yonda.rb
|
127
130
|
- lib/termtter/api.rb
|
128
131
|
- lib/termtter/client.rb
|
129
132
|
- lib/termtter/command.rb
|
133
|
+
- lib/termtter/config.rb
|
130
134
|
- lib/termtter/connection.rb
|
131
135
|
- lib/termtter/hook.rb
|
132
|
-
- lib/termtter/
|
136
|
+
- lib/termtter/optparse.rb
|
133
137
|
- lib/termtter/system_extensions.rb
|
134
138
|
- lib/termtter/task.rb
|
135
139
|
- lib/termtter/task_manager.rb
|
136
|
-
- lib/termtter/twitter.rb
|
137
|
-
- lib/termtter/user.rb
|
138
140
|
- lib/termtter/version.rb
|
139
141
|
- lib/termtter.rb
|
140
142
|
- spec/plugin/cool_spec.rb
|
143
|
+
- spec/plugin/english_spec.rb
|
144
|
+
- spec/plugin/favorite_spec.rb
|
141
145
|
- spec/plugin/fib_spec.rb
|
142
146
|
- spec/plugin/filter_spec.rb
|
147
|
+
- spec/plugin/pause_spec.rb
|
143
148
|
- spec/plugin/plugin_spec.rb
|
149
|
+
- spec/plugin/primes_spec.rb
|
144
150
|
- spec/plugin/shell_spec.rb
|
151
|
+
- spec/plugin/sl_spec.rb
|
145
152
|
- spec/plugin/spam_spec.rb
|
146
153
|
- spec/plugin/standard_plugins_spec.rb
|
154
|
+
- spec/plugin/storage/DB_spec.rb
|
155
|
+
- spec/plugin/storage/status_spec.rb
|
147
156
|
- spec/spec_helper.rb
|
148
157
|
- spec/termtter/client_spec.rb
|
149
158
|
- spec/termtter/command_spec.rb
|
159
|
+
- spec/termtter/config_spec.rb
|
160
|
+
- spec/termtter/hook_spec.rb
|
150
161
|
- spec/termtter/task_manager_spec.rb
|
151
162
|
- spec/termtter/task_spec.rb
|
152
|
-
- spec/termtter/user_spec.rb
|
153
163
|
- spec/termtter_spec.rb
|
154
|
-
- test/test_termtter.rb
|
155
164
|
- test/friends_timeline.json
|
156
165
|
- test/search.json
|
157
166
|
- README.rdoc
|
data/lib/filter/english.rb
DELETED
data/lib/filter/ignore.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
|
4
|
-
configatron.filters.ignore.set_default(:words, [])
|
5
|
-
|
6
|
-
module Termtter::Client
|
7
|
-
add_filter do |statuses|
|
8
|
-
ignore_words = configatron.filters.ignore.words
|
9
|
-
statuses.delete_if do |s|
|
10
|
-
ignore_words.any? {|i| i =~ s.text }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
# filter/ignore.rb
|
16
|
-
# ignore words
|
17
|
-
# setting
|
18
|
-
# configatron.filters.ignore.words = [ /ignore/, /words/ ]
|
19
|
-
|
data/lib/filter/yhara.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
module Termtter
|
4
|
-
|
5
|
-
class Status
|
6
|
-
def yharian?
|
7
|
-
self.text =~ /^(?:\s|(y\s)|(?:hara\s))+\s*(?:y|(?:hara))(?:\?|!|\.)?\s*$/
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
module Client
|
12
|
-
add_filter do |statuses|
|
13
|
-
statuses.select{|s| s.yharian? }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# filter-yhara.rb
|
19
|
-
# select Yharian post only
|
20
|
-
|
data/lib/plugin/bomb.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
module Termtter
|
4
|
-
class Status
|
5
|
-
def bomb?
|
6
|
-
/爆発|bomb/ =~ self.text
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
module Client
|
11
|
-
register_command(
|
12
|
-
:name => :bomb, :aliases => [],
|
13
|
-
:exec_proc => lambda {|arg|
|
14
|
-
text = "#{arg.strip} 爆発しろ!"
|
15
|
-
Termtter::API::twitter.update_status(text)
|
16
|
-
puts "=> #{text}"
|
17
|
-
},
|
18
|
-
:help => ['bomb WORD', 'Bomb it']
|
19
|
-
)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# bomb.rb
|
24
|
-
# Bomb it!
|
25
|
-
#
|
26
|
-
# See http://gyazo.com/4b33517380673d92f51a52e675ecdb02.png .
|
27
|
-
# configatron.plugins.stdout.timeline_format =
|
28
|
-
# %q[<90><%=time%></90> <%= s.bomb? ? "<37><41>#{status}</41></37>" : "<#{status_color}>#{status}</#{status_color}>" %> <90><%=id%></90>]
|
29
|
-
# vim: fenc=utf8
|