progress 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/lib/progress/beeper.rb +5 -7
- data/progress.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTRkZThiZjMwMWU0ZmRiNGE4NDNmYTdiNWQyNjkxYmEzYjNjYjEzNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
ODhlNTFhZTNmMTdlNzI1MTUwN2YzZTU2ODk5OWI2YTAzZmZhYzAyZQ==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTNjMGYwYTYwODAxNWZkODE4MWY3ZmExZTNjNWRkMWEyZTFhMDZkMmJmNTUy
|
10
|
+
M2EwMjRmYmVlNDQwMTliMmEzNTdjMGE0ZGVlMmE5Mjk5YjQ1MWEwZGUwZGVm
|
11
|
+
YTg3OTFiZDBlMjFmMjY3ODFmMjYwNzk0YzZkZjc5YzMzOWI2NTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmI1NTEwOTNjNmFkMDc0OTYwNWE4MzI0ZTFiNzNmODQyM2FlYzEzMjE1YmY5
|
14
|
+
NDljZDNjOWM5ZWFjZmViZGI0ODMwYmRiZGM0ZDNjNDcyNWMzZDgzNDk4OGQ2
|
15
|
+
ZGQzODI3ZDVjYmJiZjZhZTZhN2Q0MWE3YTJlMzJmYWNlM2RmOTg=
|
data/lib/progress/beeper.rb
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
class Progress
|
2
2
|
class Beeper
|
3
|
-
class Restart < RuntimeError; end
|
4
|
-
|
5
3
|
def initialize(time, &block)
|
6
4
|
@thread = Thread.new do
|
7
|
-
|
5
|
+
loop do
|
6
|
+
@skip = false
|
8
7
|
sleep time
|
9
|
-
block.call
|
10
|
-
rescue Restart
|
8
|
+
block.call unless @skip
|
11
9
|
end
|
12
|
-
redo
|
13
10
|
end
|
14
11
|
end
|
15
12
|
|
16
13
|
def restart
|
17
|
-
@
|
14
|
+
@skip = true
|
15
|
+
@thread.run
|
18
16
|
end
|
19
17
|
|
20
18
|
def stop
|
data/progress.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: progress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Kuchin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
66
|
rubyforge_project: progress
|
67
|
-
rubygems_version: 2.
|
67
|
+
rubygems_version: 2.4.5
|
68
68
|
signing_key:
|
69
69
|
specification_version: 4
|
70
70
|
summary: Show progress of long running tasks
|