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: 4dc515ceea5248b2ac05129ad6b2f5d074742819
4
- data.tar.gz: e68e4458184d953024a5efe23083dfc4a3f9ba8c
3
+ metadata.gz: 0dc602345c49b93508d7c2b225dc5e18a93646dc
4
+ data.tar.gz: 0f05f99e159f6f9fb10541c83d91ac82aa7cda9d
5
5
  SHA512:
6
- metadata.gz: 9c32534cc602929cfcc7b0d98d47f868e8838adc1de117ffe31a2f73e64bcd9b6679cf09af40daf8ec5e2b4bd9da86106c4fa05f02e8a350e536d606f4ef9d19
7
- data.tar.gz: 932ebf6722c3e7fafe391b0e725eb2d2ef280b9187ccc365bf76ca39bc78d2100e5db415caa183de646ed2d9967f9a8c4b290b87203295af45666c299dd1bea1
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
- @instrument_block = block
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 = instrument_block.call
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, &bound_block)
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,
@@ -2,7 +2,7 @@ module UltraMarathon
2
2
  class Version
3
3
  MAJOR = 0 unless defined? MAJOR
4
4
  MINOR = 1 unless defined? MINOR
5
- PATCH = 1 unless defined? PATCH
5
+ PATCH = 2 unless defined? PATCH
6
6
  PRE = nil unless defined? PRE
7
7
 
8
8
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultra_marathon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Maddox