speedometer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/speedometer.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16ea2d6dc5f2dc611a46b92d320d1f0ef98262fe
|
4
|
+
data.tar.gz: fa2d181d1bfc89e9d3879ae429f15f069a2a231d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd039ae5d70bb89badb38b034e33714944186359b5b1cdbc72c36c411434113b3c90426f92a891c54e5ca07552e34a3acf0c1a0d02c0662561bd156180e0617
|
7
|
+
data.tar.gz: 4e0561c9a42a9d11fa1017b3fc1a37aed531a8f706eac579197623c154856a866c131b6a85e8c6d383c1bea92b601fd1ad79249ec8f80e7ee9123d21a2a716c5
|
data/lib/speedometer.rb
CHANGED
@@ -39,8 +39,11 @@ class Speedometer
|
|
39
39
|
length = `stty`
|
40
40
|
length = length.split.last.to_i
|
41
41
|
print "\r"
|
42
|
+
STDOUT.flush
|
42
43
|
print "#{' ' * length}"
|
44
|
+
STDOUT.flush
|
43
45
|
print "\r"
|
46
|
+
STDOUT.flush
|
44
47
|
end
|
45
48
|
|
46
49
|
def display
|
@@ -54,6 +57,7 @@ class Speedometer
|
|
54
57
|
speed = speed / 1024
|
55
58
|
end
|
56
59
|
print "#{speed.round(2)}#{@units}/s"
|
60
|
+
STDOUT.flush
|
57
61
|
sleep @refresh_time.to_f / 1000
|
58
62
|
end
|
59
63
|
|