ultra_marathon 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dc602345c49b93508d7c2b225dc5e18a93646dc
|
4
|
+
data.tar.gz: 0f05f99e159f6f9fb10541c83d91ac82aa7cda9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a38d2315e48905e5c10fe4b5ff91cd3e9e2b947a1b5187d93e9e5f17d3c31f5c00a7ce70555297ffcc48bc021d877d8469efcc88bdaf474bcc55a676174078fc
|
7
|
+
data.tar.gz: dcecb158baddd172cabe0c4a2c2320dbc94d94ded033055befe868f5d74c32756be5588819f90593cd13c958bedbd09f0a141c8a46ac5352cb361b2a1e9006b3
|
@@ -7,13 +7,17 @@ module UltraMarathon
|
|
7
7
|
|
8
8
|
def initialize(name, &block)
|
9
9
|
@name = name
|
10
|
-
|
10
|
+
# Ruby cannot marshal procs or lambdas, so we need to define a method.
|
11
|
+
# Binding to self allows us to intercept logging calls.
|
12
|
+
define_singleton_method :instrumentated_block do
|
13
|
+
block.call
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
def call
|
14
18
|
@start_time = Time.now
|
15
19
|
begin
|
16
|
-
return_value =
|
20
|
+
return_value = instrumentated_block
|
17
21
|
ensure
|
18
22
|
@end_time = Time.now
|
19
23
|
end
|
@@ -92,14 +92,9 @@ module UltraMarathon
|
|
92
92
|
|
93
93
|
def initialize(context, run_block)
|
94
94
|
@context = context
|
95
|
-
@run_block = run_block
|
96
95
|
# Ruby cannot marshal procs or lambdas, so we need to define a method.
|
97
96
|
# Binding to self allows us to intercept logging calls.
|
98
|
-
define_singleton_method(:call, &
|
99
|
-
end
|
100
|
-
|
101
|
-
def bound_block
|
102
|
-
run_block.bind(self)
|
97
|
+
define_singleton_method(:call, &run_block.bind(self))
|
103
98
|
end
|
104
99
|
|
105
100
|
# If the original context responds, including private methods,
|