thread_storm 0.5.0 → 0.5.1

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 0.5.1
2
+ - Fixed crash when calling Execution#duration before it has started.
3
+ - ThreadStorm#clear_executions can now take no arguments at all.
4
+ - Execution#value implicitly calls Execution#join.
5
+
1
6
  0.5.0
2
7
  - Refactored to use Monitor.
3
8
  - Implemented ThreadStorm#clear_executions.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -56,8 +56,10 @@ class ThreadStorm
56
56
  def duration
57
57
  if finished?
58
58
  finish_time - start_time
59
- else
59
+ elsif started?
60
60
  Time.now - start_time
61
+ else
62
+ -1
61
63
  end
62
64
  end
63
65
 
@@ -83,7 +85,9 @@ class ThreadStorm
83
85
  end
84
86
 
85
87
  # The value returned by the execution's code block.
88
+ # This implicitly calls join.
86
89
  def value
90
+ join
87
91
  @value
88
92
  end
89
93
 
data/lib/thread_storm.rb CHANGED
@@ -99,6 +99,8 @@ class ThreadStorm
99
99
  cleared, @executions = @executions.separate do |execution|
100
100
  if block_given?
101
101
  yield(execution)
102
+ elsif method_name.nil?
103
+ true
102
104
  else
103
105
  execution.send(method_name)
104
106
  end
data/thread_storm.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{thread_storm}
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Christopher J. Bottaro"]
12
- s.date = %q{2010-06-21}
12
+ s.date = %q{2010-06-24}
13
13
  s.description = %q{Simple thread pool with timeouts, default values, error handling, state tracking and unit tests.}
14
14
  s.email = %q{cjbottaro@alumni.cs.utexas.edu}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thread_storm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christopher J. Bottaro
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-21 00:00:00 -05:00
18
+ date: 2010-06-24 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21