lapidarius 4.1.0 → 4.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 662c7f9cb912bbd9b30b03badf183aaf24fd437c4344a2fc3a0834880de5ee27
4
- data.tar.gz: 7187b0b9f13dae1d38851f1563e326e8a67b705c5f23bd5011f6ad141e4037f1
3
+ metadata.gz: 4b4a2c0187f701688485bf6edc72d937acc39f299696786e6f8afb73ff761d73
4
+ data.tar.gz: 1d1ef685fe8e2f5e95c8efbe96c1bda37cc7b60244fcf4919e3d056830b64e6c
5
5
  SHA512:
6
- metadata.gz: 1789815ca25aa747d7c628ba444331e84e60055689ad03e97d9df883c14e30b85fb0225efb97066634323c3c411369ab28650ee2bd0f48438c6df975d855dc40
7
- data.tar.gz: 333c63d14cfff43d1b9967c6bcabf9e52b462f17aeec55a4c2c44dad43a4616899844bd0c41a0028dbe1d5a43f96fe58d7cc398bc839ad07b44208b9a5feb714
6
+ metadata.gz: 76082b3153e51350c5392460f15766b9403c6f197a3bdbd46d9575285836b1e913c9719549b4911ad5203cfaf6a61b30ef0f09561908c16048197188845fa294
7
+ data.tar.gz: 1ea3796a74d4cb46d9c3da50d14bd831e769171ed46da65003ffe090760b81287f9fc0d217610ebaabd63cc41838c639bd32e4e844f762315f75a2a72e274609
@@ -21,15 +21,16 @@ module Lapidarius
21
21
 
22
22
  def call
23
23
  @spinner.call do
24
- @io.puts output
24
+ @output = cut
25
25
  end
26
+ @io.puts @output
26
27
  end
27
28
 
28
29
  private def cutter
29
30
  @cutter.new(name: @name, cmd_klass: @command, version: @version, remote: @remote)
30
31
  end
31
32
 
32
- private def output
33
+ private def cut
33
34
  return unless @name
34
35
  gem = cutter.call
35
36
  @tree::new(gem).to_s
@@ -64,7 +65,8 @@ module Lapidarius
64
65
  class Spinner
65
66
  CHARS = %w[| / - \\]
66
67
 
67
- def initialize(fps = 15, delay = 1.0)
68
+ def initialize(io = STDOUT, fps = 15, delay = 1.0)
69
+ @io = io
68
70
  @fps = fps.to_i
69
71
  @delay = delay.to_f / @fps
70
72
  @iter = 0
@@ -73,11 +75,13 @@ module Lapidarius
73
75
  def call
74
76
  spinner = Thread.new do
75
77
  while @iter do
76
- print CHARS[(@iter+=1) % CHARS.length]
78
+ @io.print CHARS[(@iter+=1) % CHARS.length]
77
79
  sleep @delay
78
- print "\b"
80
+ @io.print "\b"
81
+ @io.flush
79
82
  end
80
83
  end
84
+ ensure
81
85
  yield.tap do
82
86
  @iter = false
83
87
  spinner.join
@@ -1,3 +1,3 @@
1
1
  module Lapidarius
2
- VERSION = "4.1.0"
2
+ VERSION = "4.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lapidarius
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - costajob