whirly 0.2.3 → 0.2.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +3 -3
- data/data/whirly-static-spinners.json +49 -0
- data/examples/euruko.rb +1 -1
- data/examples/single.rb +1 -1
- data/lib/.whirly.rb.swp +0 -0
- data/lib/whirly.rb +5 -2
- data/lib/whirly/spinners/whirly.rb +1 -5
- data/lib/whirly/version.rb +1 -1
- data/spec/whirly_spec.rb +14 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f69b668e3ed248d4353ae4d0d45a0b1556435d18
|
4
|
+
data.tar.gz: b57f46e4c21d95ad19a29be45bf99abefc1e80fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f25ab43a137b933d7daf44ff0ce4beedf57eaa8afa8b0d2b70ac42e94ec2a6a5b85c491d6248cf414082a3d4a080bcd573ecb50a2570a707bf93164c982971c
|
7
|
+
data.tar.gz: 7053d6533a53af42794609d0859495f70b8aaa6bee21635089dfb7f2d20f25cea155a34bf8f60c5c84ec2ef29d0b34facdfafda3827cfeff2d74f19ff5d56469
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Whirly 😀 [![[version]](https://badge.fury.io/rb/whirly.svg)](http://badge.fury.io/rb/whirly) [![[travis]](https://travis-ci.org/janlelis/whirly.
|
1
|
+
# Whirly 😀 [![[version]](https://badge.fury.io/rb/whirly.svg)](http://badge.fury.io/rb/whirly) [![[travis]](https://travis-ci.org/janlelis/whirly.svg)](https://travis-ci.org/janlelis/whirly)
|
2
2
|
|
3
|
-
A simple, colorful and customizable terminal spinner library for Ruby. It comes with
|
3
|
+
A simple, colorful and customizable terminal spinner library for Ruby. It comes with 24 custom spinners and also includes those from the [cli-spinners](https://github.com/sindresorhus/cli-spinners) project.
|
4
4
|
|
5
5
|
## Demonstration
|
6
6
|
|
@@ -60,7 +60,7 @@ Whirly.stop
|
|
60
60
|
The `start` method takes a lot of options, like which spinner to use or an initial status. See further below for the full description of available options.
|
61
61
|
|
62
62
|
```ruby
|
63
|
-
Whirly.start spinner: "pong",
|
63
|
+
Whirly.start spinner: "pong", color: false, status: "The Game of Pong" do
|
64
64
|
sleep 10
|
65
65
|
end
|
66
66
|
```
|
@@ -221,5 +221,54 @@
|
|
221
221
|
"🞎",
|
222
222
|
"🞔"
|
223
223
|
]
|
224
|
+
},
|
225
|
+
"xberg": {
|
226
|
+
"interval": 150,
|
227
|
+
"mode": "random",
|
228
|
+
"frames": [
|
229
|
+
"⨯",
|
230
|
+
"⛰",
|
231
|
+
"⛰",
|
232
|
+
"⛰",
|
233
|
+
"⛰",
|
234
|
+
"⛰",
|
235
|
+
"⛰"
|
236
|
+
]
|
237
|
+
},
|
238
|
+
"circled_letter": {
|
239
|
+
"interval": 120,
|
240
|
+
"mode": "random",
|
241
|
+
"frames": [
|
242
|
+
"Ⓐ", "Ⓑ", "Ⓒ", "Ⓓ", "Ⓔ", "Ⓕ", "Ⓖ", "Ⓗ", "Ⓘ",
|
243
|
+
"Ⓙ", "Ⓚ", "Ⓛ", "Ⓜ", "Ⓝ", "Ⓞ", "Ⓟ", "Ⓠ", "Ⓡ",
|
244
|
+
"Ⓢ", "Ⓣ", "Ⓤ", "Ⓥ", "Ⓦ", "Ⓧ", "Ⓨ", "Ⓩ"
|
245
|
+
]
|
246
|
+
},
|
247
|
+
"circled_number": {
|
248
|
+
"interval": 120,
|
249
|
+
"mode": "random",
|
250
|
+
"frames": [
|
251
|
+
"①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨"
|
252
|
+
]
|
253
|
+
},
|
254
|
+
"letter_with_parens": {
|
255
|
+
"interval": 150,
|
256
|
+
"mode": "random",
|
257
|
+
"frames": [
|
258
|
+
"🄐", "🄑", "🄒", "🄓", "🄔", "🄕", "🄖", "🄗", "🄘",
|
259
|
+
"🄙", "🄚", "🄛", "🄜", "🄝", "🄞", "🄟", "🄠", "🄡",
|
260
|
+
"🄢", "🄣", "🄤", "🄥", "🄦", "🄧", "🄨", "🄩"
|
261
|
+
]
|
262
|
+
},
|
263
|
+
"starlike": {
|
264
|
+
"interval": 120,
|
265
|
+
"mode": "random",
|
266
|
+
"frames": [
|
267
|
+
"✩", "✪", "✫", "✬", "✭", "✮", "✯", "✰",
|
268
|
+
"✱", "✲", "✳", "✴", "✵", "✶", "✷", "✸",
|
269
|
+
"✹", "✺", "✻", "✼", "✽", "✾", "✿", "❀",
|
270
|
+
"❁", "❂", "❃", "❄", "❅", "❆", "❇", "❈",
|
271
|
+
"❉", "❊"
|
272
|
+
]
|
224
273
|
}
|
225
274
|
}
|
data/examples/euruko.rb
CHANGED
@@ -45,7 +45,7 @@ sleep 5
|
|
45
45
|
print "\033c"
|
46
46
|
puts Paint["Pong", :underline]
|
47
47
|
|
48
|
-
Whirly.start spinner: "pong",
|
48
|
+
Whirly.start spinner: "pong", color: false, status: "Two computers in a game of Pong" do
|
49
49
|
sleep 9
|
50
50
|
end
|
51
51
|
|
data/examples/single.rb
CHANGED
data/lib/.whirly.rb.swp
ADDED
Binary file
|
data/lib/whirly.rb
CHANGED
@@ -4,13 +4,9 @@ module Whirly
|
|
4
4
|
module Spinners
|
5
5
|
WHIRLY = {
|
6
6
|
"random_dots" => { "proc" => ->(){ [ 0x2800 + rand(256)].pack("U") }, "interval" => 100 },
|
7
|
-
"circled_letter" => { "proc" => ->(){ [ 0x24B6 + rand(26) ].pack("U") }, "interval" => 120 },
|
8
|
-
"circled_number" => { "proc" => ->(){ [ 0x2460 + rand(9) ].pack("U") }, "interval" => 120 },
|
9
|
-
"starlike" => { "proc" => ->(){ [ 0x2729 + rand(34) ].pack("U") }, "interval" => 120 },
|
10
7
|
"mahjong" => { "proc" => ->(){ [0x1F000 + rand(44)].pack("U") }, "interval" => 200 },
|
11
8
|
"domino" => { "proc" => ->(){ [0x1F030 + rand(50)].pack("U") }, "interval" => 200 },
|
12
|
-
"vertical_domino" => { "proc" => ->(){ [0x1F062 + rand(50)].pack("U") }, "interval" => 200 }
|
13
|
-
"letters_with_parens" => { "proc" => ->(){ [0x1F110 + rand(26)].pack("U") }, "interval" => 150 },
|
9
|
+
"vertical_domino" => { "proc" => ->(){ [0x1F062 + rand(50)].pack("U") }, "interval" => 200 }
|
14
10
|
}
|
15
11
|
WHIRLY.merge! JSON.load(File.read(File.dirname(__FILE__) + "/../../../data/whirly-static-spinners.json"))
|
16
12
|
|
data/lib/whirly/version.rb
CHANGED
data/spec/whirly_spec.rb
CHANGED
@@ -376,4 +376,18 @@ describe Whirly do
|
|
376
376
|
refute_predicate Whirly, :enabled?
|
377
377
|
end
|
378
378
|
end
|
379
|
+
|
380
|
+
describe "Error Handling" do
|
381
|
+
it "stops the spinner, when the main thread threw an exception [gh#3]" do
|
382
|
+
begin
|
383
|
+
Whirly.start status: "working" do
|
384
|
+
short_sleep
|
385
|
+
raise 'error!'
|
386
|
+
end
|
387
|
+
rescue
|
388
|
+
end
|
389
|
+
|
390
|
+
refute_predicate Whirly, :enabled?
|
391
|
+
end
|
392
|
+
end
|
379
393
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whirly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode-display_width
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- examples/multi_lines.rb
|
51
51
|
- examples/single.rb
|
52
52
|
- examples/status.rb
|
53
|
+
- lib/.whirly.rb.swp
|
53
54
|
- lib/whirly.rb
|
54
55
|
- lib/whirly/spinners.rb
|
55
56
|
- lib/whirly/spinners/cli.rb
|