indicator 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,6 +83,7 @@ Default increment is 1.
83
83
  spin.inc
84
84
  sleep 0.2
85
85
  end
86
+ spin.clear
86
87
  end
87
88
 
88
89
  :pre_percent and :post_percent is also available.
@@ -30,15 +30,22 @@ module Indicator
30
30
  end
31
31
 
32
32
  def spin
33
- clean
33
+ back
34
34
  build
35
35
  print @spin
36
36
  end
37
37
 
38
- def clean
38
+ def back
39
39
  printf "\b" * @spin.length if @spin.length > 0
40
40
  end
41
41
 
42
+ def clean
43
+ return unless @spin.length > 0
44
+ back
45
+ printf " " * @spin.length
46
+ back
47
+ end
48
+
42
49
  private
43
50
  def build
44
51
  @spin = @pre
@@ -1,3 +1,3 @@
1
1
  module Indicator
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indicator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &17460400 !ruby/object:Gem::Requirement
16
+ requirement: &16490760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.7.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *17460400
24
+ version_requirements: *16490760
25
25
  description: Sometimes you need to display activity on the text console to inform
26
26
  the user that the program is actually doing something. Be funny with a lot predefined
27
27
  sets or make you own widget to display an animation text during a long-running process