hustle 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/hustle.rb +3 -4
- data/lib/hustle/runner.rb +5 -1
- data/lib/hustle/version.rb +1 -1
- data/test/hustle_test.rb +13 -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: 462fcf478bc5d9197719e9ef8bba3fe84b37feb0
|
4
|
+
data.tar.gz: f3fc2d990f6785078a950ba50db9ee054d1f2f3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1622258db577a0920d424f748f8a69db14dcf25be289a49c788822badb6afa878913b131f8a66dec1efaeba7e7fd2d8caee9b366fe92b8780de7f366359223ad
|
7
|
+
data.tar.gz: caf7fc6a675195d560c795847ef2a1c59ac2a406dcf082156ffe6fb4d655026ee44ba7bb06be5e40a77b24130ad2a7814502b1640163a6cc030c3fbda1ee9277
|
data/lib/hustle.rb
CHANGED
@@ -46,6 +46,9 @@ module Hustle
|
|
46
46
|
runner = Runner.new(uri)
|
47
47
|
runner.start_remote_instance
|
48
48
|
sleep 0 while !runner.remote_instance_ready?
|
49
|
+
synchronize do
|
50
|
+
active_runners[runner.pid] = runner
|
51
|
+
end
|
49
52
|
runner.run_remote(&block)
|
50
53
|
finish runner, callback
|
51
54
|
end
|
@@ -77,10 +80,6 @@ module Hustle
|
|
77
80
|
end
|
78
81
|
callback.call value
|
79
82
|
end
|
80
|
-
|
81
|
-
synchronize do
|
82
|
-
active_runners[runner.pid] = runner
|
83
|
-
end
|
84
83
|
end
|
85
84
|
|
86
85
|
end
|
data/lib/hustle/runner.rb
CHANGED
data/lib/hustle/version.rb
CHANGED
data/test/hustle_test.rb
CHANGED
@@ -37,5 +37,18 @@ class HustleTest < MicroTest::Test
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
test "error in block" do
|
41
|
+
error_message = "Error in the block!"
|
42
|
+
|
43
|
+
asserts = -> (value) do
|
44
|
+
assert value.is_a?(StandardError)
|
45
|
+
assert value.message == error_message
|
46
|
+
end
|
47
|
+
|
48
|
+
Hustle.go(callback: asserts) do
|
49
|
+
raise error_message
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
40
53
|
end
|
41
54
|
|