benelux 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,5 +1,10 @@
1
1
  BENELUX, CHANGES
2
2
 
3
+ #### 0.5.9 (2010-03-05) ###############################
4
+
5
+ * ADDED: Benelux::Stats::Calculator#from_hash
6
+ * ADDED: Benelux::Stats::Group#sumsq
7
+
3
8
 
4
9
  #### 0.5.8 (2010-03-05) ###############################
5
10
 
data/benelux.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "benelux"
3
3
  s.rubyforge_project = 'benelux'
4
- s.version = "0.5.8"
4
+ s.version = "0.5.9"
5
5
  s.summary = "Benelux: A mad way to time Ruby codes"
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
data/lib/benelux.rb CHANGED
@@ -4,7 +4,7 @@ require 'thwait'
4
4
  require 'selectable'
5
5
 
6
6
  module Benelux
7
- VERSION = "0.5.8"
7
+ VERSION = "0.5.9"
8
8
  NOTSUPPORTED = [Class, Object, Kernel]
9
9
 
10
10
  class BeneluxError < RuntimeError; end
data/lib/benelux/stats.rb CHANGED
@@ -108,6 +108,7 @@ module Benelux
108
108
  def mean() merge.mean end
109
109
  def min() merge.min end
110
110
  def max() merge.max end
111
+ def sumsq() merge.sumsq end
111
112
  def sum() merge.sum end
112
113
  def sd() merge.sd end
113
114
  def n() merge.n end
@@ -219,6 +220,16 @@ module Benelux
219
220
  { :min => min, :mean => mean, :max => max, :sd => sd, :n => n, :sum => @sum, :sumsq => @sumsq }
220
221
  end
221
222
 
223
+ def self.from_hash(hash={})
224
+ me = new
225
+ me.instance_variable_set '@min', hash[:min] || hash['min']
226
+ me.instance_variable_set '@max', hash[:max] || hash['max']
227
+ me.instance_variable_set '@n', hash[:n] || hash['n']
228
+ me.instance_variable_set '@sum', hash[:sum] || hash['sum']
229
+ me.instance_variable_set '@sumsq', hash[:sumsq] || hash['sumsq']
230
+ me
231
+ end
232
+
222
233
  def to_json
223
234
  to_hash.to_json
224
235
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benelux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-05 00:00:00 -05:00
12
+ date: 2010-03-15 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15