twterm 2.7.0 → 2.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +62 -0
- data/.gitattributes +4 -0
- data/.gitignore +1 -0
- data/Gemfile +7 -0
- data/Makefile +21 -0
- data/README.md +52 -6
- data/bin/twterm +1 -3
- data/default.nix +21 -0
- data/gemset.nix +5130 -0
- data/lib/twterm/app.rb +13 -8
- data/lib/twterm/color_manager.rb +8 -9
- data/lib/twterm/image.rb +31 -0
- data/lib/twterm/image/attr.rb +42 -0
- data/lib/twterm/image/bold.rb +7 -21
- data/lib/twterm/image/color.rb +9 -15
- data/lib/twterm/image/dim.rb +13 -0
- data/lib/twterm/image/underlined.rb +17 -0
- data/lib/twterm/image_builder/user_name_image_builder.rb +1 -0
- data/lib/twterm/key_mapper.rb +6 -8
- data/lib/twterm/key_mapper/abstract_key_mapper.rb +2 -2
- data/lib/twterm/list.rb +36 -1
- data/lib/twterm/message_window.rb +4 -13
- data/lib/twterm/persistable_configuration_proxy.rb +6 -6
- data/lib/twterm/preferences.rb +8 -1
- data/lib/twterm/screen.rb +103 -25
- data/lib/twterm/search_query_window.rb +5 -13
- data/lib/twterm/status.rb +10 -0
- data/lib/twterm/tab/abstract_tab.rb +30 -16
- data/lib/twterm/tab/new/search.rb +2 -2
- data/lib/twterm/tab/new/user.rb +2 -2
- data/lib/twterm/tab/preferences/control.rb +77 -0
- data/lib/twterm/tab/preferences/index.rb +6 -0
- data/lib/twterm/tab/scrollable.rb +1 -1
- data/lib/twterm/tab/searchable.rb +6 -4
- data/lib/twterm/tab/status_tab.rb +10 -0
- data/lib/twterm/tab/statuses/abstract_statuses_tab.rb +11 -6
- data/lib/twterm/tab_manager.rb +77 -10
- data/lib/twterm/tweetbox.rb +2 -3
- data/lib/twterm/user.rb +1 -0
- data/lib/twterm/version.rb +1 -1
- data/nix/Gemfile +3 -0
- data/nix/Gemfile.lock +77 -0
- data/nix/gemset.nix +325 -0
- data/shell.nix +40 -0
- data/spec/twterm/image/bold_spec.rb +30 -0
- data/spec/twterm/image/color_spec.rb +16 -0
- data/spec/twterm/image/dim_spec.rb +30 -0
- data/twterm.gemspec +7 -14
- metadata +35 -108
- data/.travis.yml +0 -12
- data/lib/twterm/event/screen/resize.rb +0 -13
- data/spec/twterm/event/screen/resize_spec.rb +0 -11
data/nix/gemset.nix
ADDED
@@ -0,0 +1,325 @@
|
|
1
|
+
{
|
2
|
+
addressable = {
|
3
|
+
dependencies = ["public_suffix"];
|
4
|
+
groups = ["default"];
|
5
|
+
platforms = [];
|
6
|
+
source = {
|
7
|
+
remotes = ["https://rubygems.org"];
|
8
|
+
sha256 = "1fvchp2rhp2rmigx7qglf69xvjqvzq7x0g49naliw29r2bz656sy";
|
9
|
+
type = "gem";
|
10
|
+
};
|
11
|
+
version = "2.7.0";
|
12
|
+
};
|
13
|
+
buftok = {
|
14
|
+
groups = ["default"];
|
15
|
+
platforms = [];
|
16
|
+
source = {
|
17
|
+
remotes = ["https://rubygems.org"];
|
18
|
+
sha256 = "1rzsy1vy50v55x9z0nivf23y0r9jkmq6i130xa75pq9i8qrn1mxs";
|
19
|
+
type = "gem";
|
20
|
+
};
|
21
|
+
version = "0.2.0";
|
22
|
+
};
|
23
|
+
citrus = {
|
24
|
+
groups = ["default"];
|
25
|
+
platforms = [];
|
26
|
+
source = {
|
27
|
+
remotes = ["https://rubygems.org"];
|
28
|
+
sha256 = "0l7nhk3gkm1hdchkzzhg2f70m47pc0afxfpl6mkiibc9qcpl3hjf";
|
29
|
+
type = "gem";
|
30
|
+
};
|
31
|
+
version = "3.0.2";
|
32
|
+
};
|
33
|
+
concurrent-ruby = {
|
34
|
+
groups = ["default"];
|
35
|
+
platforms = [];
|
36
|
+
source = {
|
37
|
+
remotes = ["https://rubygems.org"];
|
38
|
+
sha256 = "0mr23wq0szj52xnj0zcn1k0c7j4v79wlwbijkpfcscqww3l6jlg3";
|
39
|
+
type = "gem";
|
40
|
+
};
|
41
|
+
version = "1.1.8";
|
42
|
+
};
|
43
|
+
curses = {
|
44
|
+
groups = ["default"];
|
45
|
+
platforms = [];
|
46
|
+
source = {
|
47
|
+
remotes = ["https://rubygems.org"];
|
48
|
+
sha256 = "0i4j6j18ih6lx7gk9jg2p7q8iswc897mgzn5m62jbf0zv0f7mkji";
|
49
|
+
type = "gem";
|
50
|
+
};
|
51
|
+
version = "1.4.0";
|
52
|
+
};
|
53
|
+
domain_name = {
|
54
|
+
dependencies = ["unf"];
|
55
|
+
groups = ["default"];
|
56
|
+
platforms = [];
|
57
|
+
source = {
|
58
|
+
remotes = ["https://rubygems.org"];
|
59
|
+
sha256 = "0lcqjsmixjp52bnlgzh4lg9ppsk52x9hpwdjd53k8jnbah2602h0";
|
60
|
+
type = "gem";
|
61
|
+
};
|
62
|
+
version = "0.5.20190701";
|
63
|
+
};
|
64
|
+
equalizer = {
|
65
|
+
groups = ["default"];
|
66
|
+
platforms = [];
|
67
|
+
source = {
|
68
|
+
remotes = ["https://rubygems.org"];
|
69
|
+
sha256 = "1kjmx3fygx8njxfrwcmn7clfhjhb6bvv3scy2lyyi0wqyi3brra4";
|
70
|
+
type = "gem";
|
71
|
+
};
|
72
|
+
version = "0.0.11";
|
73
|
+
};
|
74
|
+
ffi = {
|
75
|
+
groups = ["default"];
|
76
|
+
platforms = [];
|
77
|
+
source = {
|
78
|
+
remotes = ["https://rubygems.org"];
|
79
|
+
sha256 = "15hgiy09i8ywjihyzyvjvk42ivi3kmy6dm21s5sgg9j7y3h3zkkx";
|
80
|
+
type = "gem";
|
81
|
+
};
|
82
|
+
version = "1.14.2";
|
83
|
+
};
|
84
|
+
ffi-compiler = {
|
85
|
+
dependencies = ["ffi" "rake"];
|
86
|
+
groups = ["default"];
|
87
|
+
platforms = [];
|
88
|
+
source = {
|
89
|
+
remotes = ["https://rubygems.org"];
|
90
|
+
sha256 = "0c2caqm9wqnbidcb8dj4wd3s902z15qmgxplwyfyqbwa0ydki7q1";
|
91
|
+
type = "gem";
|
92
|
+
};
|
93
|
+
version = "1.0.1";
|
94
|
+
};
|
95
|
+
http = {
|
96
|
+
dependencies = ["addressable" "http-cookie" "http-form_data" "http-parser"];
|
97
|
+
groups = ["default"];
|
98
|
+
platforms = [];
|
99
|
+
source = {
|
100
|
+
remotes = ["https://rubygems.org"];
|
101
|
+
sha256 = "0z8vmvnkrllkpzsxi94284di9r63g9v561a16an35izwak8g245y";
|
102
|
+
type = "gem";
|
103
|
+
};
|
104
|
+
version = "4.4.1";
|
105
|
+
};
|
106
|
+
http-cookie = {
|
107
|
+
dependencies = ["domain_name"];
|
108
|
+
groups = ["default"];
|
109
|
+
platforms = [];
|
110
|
+
source = {
|
111
|
+
remotes = ["https://rubygems.org"];
|
112
|
+
sha256 = "004cgs4xg5n6byjs7qld0xhsjq3n6ydfh897myr2mibvh6fjc49g";
|
113
|
+
type = "gem";
|
114
|
+
};
|
115
|
+
version = "1.0.3";
|
116
|
+
};
|
117
|
+
http-form_data = {
|
118
|
+
groups = ["default"];
|
119
|
+
platforms = [];
|
120
|
+
source = {
|
121
|
+
remotes = ["https://rubygems.org"];
|
122
|
+
sha256 = "1wx591jdhy84901pklh1n9sgh74gnvq1qyqxwchni1yrc49ynknc";
|
123
|
+
type = "gem";
|
124
|
+
};
|
125
|
+
version = "2.3.0";
|
126
|
+
};
|
127
|
+
http-parser = {
|
128
|
+
dependencies = ["ffi-compiler"];
|
129
|
+
groups = ["default"];
|
130
|
+
platforms = [];
|
131
|
+
source = {
|
132
|
+
remotes = ["https://rubygems.org"];
|
133
|
+
sha256 = "18qqvckvqjffh88hfib6c8pl9qwk9gp89w89hl3f2s1x8hgyqka1";
|
134
|
+
type = "gem";
|
135
|
+
};
|
136
|
+
version = "1.2.3";
|
137
|
+
};
|
138
|
+
"http_parser.rb" = {
|
139
|
+
groups = ["default"];
|
140
|
+
platforms = [];
|
141
|
+
source = {
|
142
|
+
remotes = ["https://rubygems.org"];
|
143
|
+
sha256 = "15nidriy0v5yqfjsgsra51wmknxci2n2grliz78sf9pga3n0l7gi";
|
144
|
+
type = "gem";
|
145
|
+
};
|
146
|
+
version = "0.6.0";
|
147
|
+
};
|
148
|
+
idn-ruby = {
|
149
|
+
groups = ["default"];
|
150
|
+
platforms = [];
|
151
|
+
source = {
|
152
|
+
remotes = ["https://rubygems.org"];
|
153
|
+
sha256 = "07vblcyk3g72sbq12xz7xj28snpxnh3sbcnxy8bglqbfqqhvmawr";
|
154
|
+
type = "gem";
|
155
|
+
};
|
156
|
+
version = "0.1.0";
|
157
|
+
};
|
158
|
+
launchy = {
|
159
|
+
dependencies = ["addressable"];
|
160
|
+
groups = ["default"];
|
161
|
+
platforms = [];
|
162
|
+
source = {
|
163
|
+
remotes = ["https://rubygems.org"];
|
164
|
+
sha256 = "1xdyvr5j0gjj7b10kgvh8ylxnwk3wx19my42wqn9h82r4p246hlm";
|
165
|
+
type = "gem";
|
166
|
+
};
|
167
|
+
version = "2.5.0";
|
168
|
+
};
|
169
|
+
memoizable = {
|
170
|
+
dependencies = ["thread_safe"];
|
171
|
+
groups = ["default"];
|
172
|
+
platforms = [];
|
173
|
+
source = {
|
174
|
+
remotes = ["https://rubygems.org"];
|
175
|
+
sha256 = "0v42bvghsvfpzybfazl14qhkrjvx0xlmxz0wwqc960ga1wld5x5c";
|
176
|
+
type = "gem";
|
177
|
+
};
|
178
|
+
version = "0.4.2";
|
179
|
+
};
|
180
|
+
multipart-post = {
|
181
|
+
groups = ["default"];
|
182
|
+
platforms = [];
|
183
|
+
source = {
|
184
|
+
remotes = ["https://rubygems.org"];
|
185
|
+
sha256 = "1zgw9zlwh2a6i1yvhhc4a84ry1hv824d6g2iw2chs3k5aylpmpfj";
|
186
|
+
type = "gem";
|
187
|
+
};
|
188
|
+
version = "2.1.1";
|
189
|
+
};
|
190
|
+
naught = {
|
191
|
+
groups = ["default"];
|
192
|
+
platforms = [];
|
193
|
+
source = {
|
194
|
+
remotes = ["https://rubygems.org"];
|
195
|
+
sha256 = "1wwjx35zgbc0nplp8a866iafk4zsrbhwwz4pav5gydr2wm26nksg";
|
196
|
+
type = "gem";
|
197
|
+
};
|
198
|
+
version = "1.1.0";
|
199
|
+
};
|
200
|
+
oauth = {
|
201
|
+
groups = ["default"];
|
202
|
+
platforms = [];
|
203
|
+
source = {
|
204
|
+
remotes = ["https://rubygems.org"];
|
205
|
+
sha256 = "1m08365nyp0fgw2iyzj8q8qy8zml0c1hw2dd8cp82pp6656ahbh3";
|
206
|
+
type = "gem";
|
207
|
+
};
|
208
|
+
version = "0.5.5";
|
209
|
+
};
|
210
|
+
public_suffix = {
|
211
|
+
groups = ["default"];
|
212
|
+
platforms = [];
|
213
|
+
source = {
|
214
|
+
remotes = ["https://rubygems.org"];
|
215
|
+
sha256 = "1xqcgkl7bwws1qrlnmxgh8g4g9m10vg60bhlw40fplninb3ng6d9";
|
216
|
+
type = "gem";
|
217
|
+
};
|
218
|
+
version = "4.0.6";
|
219
|
+
};
|
220
|
+
rake = {
|
221
|
+
groups = ["default"];
|
222
|
+
platforms = [];
|
223
|
+
source = {
|
224
|
+
remotes = ["https://rubygems.org"];
|
225
|
+
sha256 = "1iik52mf9ky4cgs38fp2m8r6skdkq1yz23vh18lk95fhbcxb6a67";
|
226
|
+
type = "gem";
|
227
|
+
};
|
228
|
+
version = "13.0.3";
|
229
|
+
};
|
230
|
+
simple_oauth = {
|
231
|
+
groups = ["default"];
|
232
|
+
platforms = [];
|
233
|
+
source = {
|
234
|
+
remotes = ["https://rubygems.org"];
|
235
|
+
sha256 = "0dw9ii6m7wckml100xhjc6vxpjcry174lbi9jz5v7ibjr3i94y8l";
|
236
|
+
type = "gem";
|
237
|
+
};
|
238
|
+
version = "0.3.1";
|
239
|
+
};
|
240
|
+
terminal-notifier = {
|
241
|
+
groups = ["default"];
|
242
|
+
platforms = [];
|
243
|
+
source = {
|
244
|
+
remotes = ["https://rubygems.org"];
|
245
|
+
sha256 = "1slc0y8pjpw30hy21v8ypafi8r7z9jlj4bjbgz03b65b28i2n3bs";
|
246
|
+
type = "gem";
|
247
|
+
};
|
248
|
+
version = "2.0.0";
|
249
|
+
};
|
250
|
+
thread_safe = {
|
251
|
+
groups = ["default"];
|
252
|
+
platforms = [];
|
253
|
+
source = {
|
254
|
+
remotes = ["https://rubygems.org"];
|
255
|
+
sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
|
256
|
+
type = "gem";
|
257
|
+
};
|
258
|
+
version = "0.3.6";
|
259
|
+
};
|
260
|
+
toml-rb = {
|
261
|
+
dependencies = ["citrus"];
|
262
|
+
groups = ["default"];
|
263
|
+
platforms = [];
|
264
|
+
source = {
|
265
|
+
remotes = ["https://rubygems.org"];
|
266
|
+
sha256 = "0x5j95w28vj85bzw98g1dyd4gm7xpli2fdvwwrgwlay7gb3wc5jh";
|
267
|
+
type = "gem";
|
268
|
+
};
|
269
|
+
version = "2.0.1";
|
270
|
+
};
|
271
|
+
twitter = {
|
272
|
+
dependencies = ["addressable" "buftok" "equalizer" "http" "http-form_data" "http_parser.rb" "memoizable" "multipart-post" "naught" "simple_oauth"];
|
273
|
+
groups = ["default"];
|
274
|
+
platforms = [];
|
275
|
+
source = {
|
276
|
+
remotes = ["https://rubygems.org"];
|
277
|
+
sha256 = "13dmkjgsnym1avym9f7y2i2h3mlk8crqvc87drrzr4f0sf9l8g2y";
|
278
|
+
type = "gem";
|
279
|
+
};
|
280
|
+
version = "7.0.0";
|
281
|
+
};
|
282
|
+
twitter-text = {
|
283
|
+
dependencies = ["idn-ruby" "unf"];
|
284
|
+
groups = ["default"];
|
285
|
+
platforms = [];
|
286
|
+
source = {
|
287
|
+
remotes = ["https://rubygems.org"];
|
288
|
+
sha256 = "1dnmp0bj3l01nbb52zby2c7hrazcdwfg846knkrjdfl0yfmv793z";
|
289
|
+
type = "gem";
|
290
|
+
};
|
291
|
+
version = "3.1.0";
|
292
|
+
};
|
293
|
+
twterm = {
|
294
|
+
dependencies = ["concurrent-ruby" "curses" "launchy" "oauth" "terminal-notifier" "toml-rb" "twitter" "twitter-text"];
|
295
|
+
groups = ["default"];
|
296
|
+
platforms = [];
|
297
|
+
source = {
|
298
|
+
remotes = ["https://rubygems.org"];
|
299
|
+
sha256 = "1fcajwgxhfxjjg0jj5il8dgg35dkzn98yacn6f880izlry40wsfp";
|
300
|
+
type = "gem";
|
301
|
+
};
|
302
|
+
version = "2.10.1";
|
303
|
+
};
|
304
|
+
unf = {
|
305
|
+
dependencies = ["unf_ext"];
|
306
|
+
groups = ["default"];
|
307
|
+
platforms = [];
|
308
|
+
source = {
|
309
|
+
remotes = ["https://rubygems.org"];
|
310
|
+
sha256 = "0bh2cf73i2ffh4fcpdn9ir4mhq8zi50ik0zqa1braahzadx536a9";
|
311
|
+
type = "gem";
|
312
|
+
};
|
313
|
+
version = "0.1.4";
|
314
|
+
};
|
315
|
+
unf_ext = {
|
316
|
+
groups = ["default"];
|
317
|
+
platforms = [];
|
318
|
+
source = {
|
319
|
+
remotes = ["https://rubygems.org"];
|
320
|
+
sha256 = "0wc47r23h063l8ysws8sy24gzh74mks81cak3lkzlrw4qkqb3sg4";
|
321
|
+
type = "gem";
|
322
|
+
};
|
323
|
+
version = "0.0.7.7";
|
324
|
+
};
|
325
|
+
}
|
data/shell.nix
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
{ pkgs ? import <nixpkgs> { }, ruby ? 2.7 }:
|
2
|
+
|
3
|
+
with pkgs;
|
4
|
+
let
|
5
|
+
mri =
|
6
|
+
if ruby == 2.5
|
7
|
+
then ruby_2_5
|
8
|
+
else if ruby == 2.6
|
9
|
+
then ruby_2_6
|
10
|
+
else if ruby == 2.7
|
11
|
+
then ruby_2_7
|
12
|
+
else if ruby == 3.0
|
13
|
+
then ruby_3_0
|
14
|
+
else abort "Unsupported Ruby version";
|
15
|
+
gems = bundlerEnv {
|
16
|
+
pname = "twterm";
|
17
|
+
gemdir = ./.;
|
18
|
+
ruby = mri;
|
19
|
+
};
|
20
|
+
in
|
21
|
+
mkShell rec {
|
22
|
+
buildInputs = [
|
23
|
+
bundix
|
24
|
+
bundler
|
25
|
+
gems
|
26
|
+
libffi
|
27
|
+
libidn
|
28
|
+
mri
|
29
|
+
ncurses
|
30
|
+
readline
|
31
|
+
];
|
32
|
+
shellHook = ''
|
33
|
+
alias twterm='bundle exec bin/twterm'
|
34
|
+
|
35
|
+
bundle install -j=4 --path=vendor/bundle
|
36
|
+
|
37
|
+
ruby --version
|
38
|
+
bundle --version
|
39
|
+
'';
|
40
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Twterm::Image::Bold do
|
4
|
+
let(:string_image) { Twterm::Image::StringImage.new(str) }
|
5
|
+
let(:str) { 'Hello' }
|
6
|
+
|
7
|
+
describe '#height' do
|
8
|
+
subject { image.height }
|
9
|
+
|
10
|
+
let(:image) { described_class.new(string_image) }
|
11
|
+
|
12
|
+
it { is_expected.to eq string_image.height }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#to_s' do
|
16
|
+
subject { image.to_s }
|
17
|
+
|
18
|
+
let(:image) { described_class.new(string_image) }
|
19
|
+
|
20
|
+
it { is_expected.to eq "\e[1mHello\e[0m" }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#width' do
|
24
|
+
subject { image.width }
|
25
|
+
|
26
|
+
let(:image) { described_class.new(string_image) }
|
27
|
+
|
28
|
+
it { is_expected.to eq string_image.width }
|
29
|
+
end
|
30
|
+
end
|
@@ -4,6 +4,14 @@ RSpec.describe Twterm::Image::Color do
|
|
4
4
|
let(:string_image) { Twterm::Image::StringImage.new(str) }
|
5
5
|
let(:str) { 'Hello' }
|
6
6
|
|
7
|
+
describe '#height' do
|
8
|
+
subject { image.height }
|
9
|
+
|
10
|
+
let(:image) { described_class.new(string_image, :red) }
|
11
|
+
|
12
|
+
it { is_expected.to eq string_image.height }
|
13
|
+
end
|
14
|
+
|
7
15
|
describe '#to_s' do
|
8
16
|
subject { image.to_s }
|
9
17
|
|
@@ -19,4 +27,12 @@ RSpec.describe Twterm::Image::Color do
|
|
19
27
|
it { is_expected.to eq "\e[47m\e[31mHello\e[0m" }
|
20
28
|
end
|
21
29
|
end
|
30
|
+
|
31
|
+
describe '#width' do
|
32
|
+
subject { image.width }
|
33
|
+
|
34
|
+
let(:image) { described_class.new(string_image, :red) }
|
35
|
+
|
36
|
+
it { is_expected.to eq string_image.width }
|
37
|
+
end
|
22
38
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Twterm::Image::Dim do
|
4
|
+
let(:string_image) { Twterm::Image::StringImage.new(str) }
|
5
|
+
let(:str) { 'Hello' }
|
6
|
+
|
7
|
+
describe '#height' do
|
8
|
+
subject { image.height }
|
9
|
+
|
10
|
+
let(:image) { described_class.new(string_image) }
|
11
|
+
|
12
|
+
it { is_expected.to eq string_image.height }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#to_s' do
|
16
|
+
subject { image.to_s }
|
17
|
+
|
18
|
+
let(:image) { described_class.new(string_image) }
|
19
|
+
|
20
|
+
it { is_expected.to eq "\e[2mHello\e[0m" }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#width' do
|
24
|
+
subject { image.width }
|
25
|
+
|
26
|
+
let(:image) { described_class.new(string_image) }
|
27
|
+
|
28
|
+
it { is_expected.to eq string_image.width }
|
29
|
+
end
|
30
|
+
end
|