operation 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/operation/deferrable.rb +6 -2
- data/lib/operation/version.rb +1 -1
- 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: e7e8a1eefcc41e4464a3c86e301dbcbae4b0f7ef
|
4
|
+
data.tar.gz: af2e7a02187ea51123404fb7e89279faba1a64ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88838ab8ebb3bd7e56086d7947386f80c07d62efd74e3e87e36a1e40c31d4ee9e672bf4e5988f8cb335412cfff8946abc665e4f17522e8f754b7a9c5d9ef4764
|
7
|
+
data.tar.gz: 66506b9496bea6a25f47c67c7e5b9aaae966ff62c40e0b7006247a1bf40e0f4114ab2977c7869d67bec8d56189da3be7d0aa58e3cd964e879fbce2ef2011bbb3
|
data/lib/operation/deferrable.rb
CHANGED
@@ -60,11 +60,15 @@ class Operation
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
def progress(percent, code)
|
63
|
+
def progress(percent, code = nil)
|
64
64
|
return if succeeded? || failed?
|
65
65
|
|
66
66
|
progressables.each do |callback|
|
67
|
-
|
67
|
+
if percent.is_a?(::Operation::Progress)
|
68
|
+
callback.call percent
|
69
|
+
else
|
70
|
+
callback.call ::Operation::Progress.new(percent, code)
|
71
|
+
end
|
68
72
|
end
|
69
73
|
end
|
70
74
|
|
data/lib/operation/version.rb
CHANGED