accumulators 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,24 +3,17 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
 
6
+ gem 'rake'
7
+
6
8
  # Add dependencies to develop your gem here.
7
9
  # Include everything needed to run rake, tests, features, etc.
8
10
  group :development, :test do
9
- gem "rspec", "~> 2.6"
11
+ gem "rspec", "~> 2.8"
10
12
  gem "bundler", ">= 1.0"
11
13
  gem "jeweler", "~> 1.6"
12
- gem "rcov", ">= 0"
14
+ gem "simplecov"
13
15
  gem "guard"
14
16
  gem "guard-rspec"
15
- end
16
-
17
- group :mac do
18
- gem "rb-fsevent"
19
- gem "growl"
20
- end
21
-
22
- group :linux do
23
- gem "rb-inotify"
24
- gem "libnotify"
17
+ gem "ruby_gntp"
25
18
  end
26
19
 
@@ -1,10 +1,8 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- diff-lcs (1.1.2)
5
- ffi (1.0.9)
4
+ diff-lcs (1.1.3)
6
5
  git (1.2.5)
7
- growl (1.0.3)
8
6
  guard (0.3.4)
9
7
  thor (~> 0.14.6)
10
8
  guard-rspec (0.3.1)
@@ -13,21 +11,21 @@ GEM
13
11
  bundler (~> 1.0.0)
14
12
  git (>= 1.2.5)
15
13
  rake
16
- libnotify (0.5.2)
17
- ffi (~> 1.0)
18
- rake (0.9.0)
19
- rb-fsevent (0.4.0)
20
- rb-inotify (0.8.4)
21
- ffi (>= 0.5.0)
22
- rcov (0.9.9)
23
- rspec (2.6.0)
24
- rspec-core (~> 2.6.0)
25
- rspec-expectations (~> 2.6.0)
26
- rspec-mocks (~> 2.6.0)
27
- rspec-core (2.6.2)
28
- rspec-expectations (2.6.0)
14
+ multi_json (1.0.4)
15
+ rake (0.9.2)
16
+ rspec (2.8.0)
17
+ rspec-core (~> 2.8.0)
18
+ rspec-expectations (~> 2.8.0)
19
+ rspec-mocks (~> 2.8.0)
20
+ rspec-core (2.8.0)
21
+ rspec-expectations (2.8.0)
29
22
  diff-lcs (~> 1.1.2)
30
- rspec-mocks (2.6.0)
23
+ rspec-mocks (2.8.0)
24
+ ruby_gntp (0.3.4)
25
+ simplecov (0.5.4)
26
+ multi_json (~> 1.0.3)
27
+ simplecov-html (~> 0.5.3)
28
+ simplecov-html (0.5.3)
31
29
  thor (0.14.6)
32
30
 
33
31
  PLATFORMS
@@ -35,12 +33,10 @@ PLATFORMS
35
33
 
36
34
  DEPENDENCIES
37
35
  bundler (>= 1.0)
38
- growl
39
36
  guard
40
37
  guard-rspec
41
38
  jeweler (~> 1.6)
42
- libnotify
43
- rb-fsevent
44
- rb-inotify
45
- rcov
46
- rspec (~> 2.6)
39
+ rake
40
+ rspec (~> 2.8)
41
+ ruby_gntp
42
+ simplecov
@@ -18,3 +18,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ require 'jeweler'
13
13
  Jeweler::Tasks.new do |gem|
14
14
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
15
  gem.name = "accumulators"
16
- gem.homepage = "http://github.com/hgavin/accumulators"
16
+ gem.homepage = "http://github.com/gavinheavyside/accumulators"
17
17
  gem.license = "MIT"
18
18
  gem.summary = %Q{Statistical accumulators for Ruby}
19
19
  gem.description = %Q{Statistical accumulators for Ruby}
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{accumulators}
8
- s.version = "0.5.0"
7
+ s.name = "accumulators"
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 = ["Gavin Heavyside"]
12
- s.date = %q{2011-05-23}
13
- s.description = %q{Statistical accumulators for Ruby}
14
- s.email = %q{gavin@heavyside.co.uk}
12
+ s.date = "2012-07-29"
13
+ s.description = "Statistical accumulators for Ruby"
14
+ s.email = "gavin@heavyside.co.uk"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.md"
@@ -40,37 +40,43 @@ Gem::Specification.new do |s|
40
40
  "spec/lib/accumulators/sum_spec.rb",
41
41
  "spec/spec_helper.rb"
42
42
  ]
43
- s.homepage = %q{http://github.com/hgavin/accumulators}
43
+ s.homepage = "http://github.com/gavinheavyside/accumulators"
44
44
  s.licenses = ["MIT"]
45
45
  s.require_paths = ["lib"]
46
- s.rubygems_version = %q{1.6.2}
47
- s.summary = %q{Statistical accumulators for Ruby}
46
+ s.rubygems_version = "1.8.23"
47
+ s.summary = "Statistical accumulators for Ruby"
48
48
 
49
49
  if s.respond_to? :specification_version then
50
50
  s.specification_version = 3
51
51
 
52
52
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
- s.add_development_dependency(%q<rspec>, ["~> 2.6"])
53
+ s.add_runtime_dependency(%q<rake>, [">= 0"])
54
+ s.add_development_dependency(%q<rspec>, ["~> 2.8"])
54
55
  s.add_development_dependency(%q<bundler>, [">= 1.0"])
55
56
  s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
56
- s.add_development_dependency(%q<rcov>, [">= 0"])
57
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
57
58
  s.add_development_dependency(%q<guard>, [">= 0"])
58
59
  s.add_development_dependency(%q<guard-rspec>, [">= 0"])
60
+ s.add_development_dependency(%q<ruby_gntp>, [">= 0"])
59
61
  else
60
- s.add_dependency(%q<rspec>, ["~> 2.6"])
62
+ s.add_dependency(%q<rake>, [">= 0"])
63
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
61
64
  s.add_dependency(%q<bundler>, [">= 1.0"])
62
65
  s.add_dependency(%q<jeweler>, ["~> 1.6"])
63
- s.add_dependency(%q<rcov>, [">= 0"])
66
+ s.add_dependency(%q<simplecov>, [">= 0"])
64
67
  s.add_dependency(%q<guard>, [">= 0"])
65
68
  s.add_dependency(%q<guard-rspec>, [">= 0"])
69
+ s.add_dependency(%q<ruby_gntp>, [">= 0"])
66
70
  end
67
71
  else
68
- s.add_dependency(%q<rspec>, ["~> 2.6"])
72
+ s.add_dependency(%q<rake>, [">= 0"])
73
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
69
74
  s.add_dependency(%q<bundler>, [">= 1.0"])
70
75
  s.add_dependency(%q<jeweler>, ["~> 1.6"])
71
- s.add_dependency(%q<rcov>, [">= 0"])
76
+ s.add_dependency(%q<simplecov>, [">= 0"])
72
77
  s.add_dependency(%q<guard>, [">= 0"])
73
78
  s.add_dependency(%q<guard-rspec>, [">= 0"])
79
+ s.add_dependency(%q<ruby_gntp>, [">= 0"])
74
80
  end
75
81
  end
76
82
 
@@ -2,7 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  module Accumulators
4
4
  describe Sum do
5
- let(:sum){ Sum.new }
6
5
 
7
6
  context "Creation" do
8
7
  it "can be created" do
@@ -10,25 +9,25 @@ module Accumulators
10
9
  end
11
10
 
12
11
  it "returns a sum of 0 before anything is added to it" do
13
- sum.sum.should == 0
12
+ subject.sum.should == 0
14
13
  end
15
14
  end
16
15
 
17
16
  context "adding numbers or distributions" do
18
17
  it "allows integers to be added" do
19
- lambda { sum.add 5 }.should_not raise_error
18
+ lambda { subject.add 5 }.should_not raise_error
20
19
  end
21
20
 
22
21
  it "allows floats to be added" do
23
- lambda { sum.add 3.4 }.should_not raise_error
22
+ lambda { subject.add 3.4 }.should_not raise_error
24
23
  end
25
24
 
26
25
  it "allows other Sum distributions to be added" do
27
- lambda { sum.add Sum.new }.should_not raise_error
26
+ lambda { subject.add Sum.new }.should_not raise_error
28
27
  end
29
28
 
30
29
  it "raises an ArgumentError if a String is added" do
31
- lambda { sum.add "1.5" }.should raise_error(
30
+ lambda { subject.add "1.5" }.should raise_error(
32
31
  ArgumentError,
33
32
  "You may not add String to Accumulators::Sum")
34
33
  end
@@ -36,40 +35,40 @@ module Accumulators
36
35
 
37
36
  context "Correctness of int additions" do
38
37
  it "should return an Integer 6 when 1,2,3 is added" do
39
- (1..3).each{ |i| sum.add i }
38
+ (1..3).each{ |i| subject.add i }
40
39
 
41
- sum.sum.should be_a Integer
42
- sum.sum.should == 6
40
+ subject.sum.should be_a Integer
41
+ subject.sum.should == 6
43
42
  end
44
43
 
45
44
  it "should calculate the sum correctly for a set of 1000 random integers" do
46
45
  vals = []
47
46
  1000.times do
48
47
  vals << rand(100000)
49
- sum.add vals.last
48
+ subject.add vals.last
50
49
  end
51
- sum.sum.should be_a Integer
52
- sum.sum.should == vals.reduce(:+)
50
+ subject.sum.should be_a Integer
51
+ subject.sum.should == vals.reduce(:+)
53
52
  end
54
53
  end
55
54
 
56
55
  context "Correctness of float additions" do
57
56
  it "should return a Float 6.1 when 1.1, 2.8, 2.2 is added" do
58
- [1.1,2.8,2.2].each{|f| sum.add f}
57
+ [1.1,2.8,2.2].each{|f| subject.add f}
59
58
 
60
- sum.sum.should be_a Float
61
- sum.sum.should be_within(EPSILON).of(6.1)
59
+ subject.sum.should be_a Float
60
+ subject.sum.should be_within(EPSILON).of(6.1)
62
61
  end
63
62
 
64
63
  it "should calculate the sum correctly for a set of 1000 random floats" do
65
64
  vals = []
66
65
  1000.times do
67
66
  vals << rand * 1000000
68
- sum.add vals.last
67
+ subject.add vals.last
69
68
  end
70
69
 
71
- sum.sum.should be_a Float
72
- sum.sum.should be_within(EPSILON).of(vals.reduce(:+))
70
+ subject.sum.should be_a Float
71
+ subject.sum.should be_within(EPSILON).of(vals.reduce(:+))
73
72
  end
74
73
  end
75
74
 
@@ -79,14 +78,14 @@ module Accumulators
79
78
  vals = []
80
79
  500.times do
81
80
  vals << rand * 1000*1000
82
- sum.add vals.last
81
+ subject.add vals.last
83
82
  vals << rand * 100*1000
84
83
  s2.add vals.last
85
84
  end
86
85
 
87
- sum.add(s2)
88
- sum.sum.should be_a Float
89
- sum.sum.should be_within(EPSILON).of(vals.reduce(:+))
86
+ subject.add(s2)
87
+ subject.sum.should be_a Float
88
+ subject.sum.should be_within(EPSILON).of(vals.reduce(:+))
90
89
  end
91
90
  end
92
91
  end
metadata CHANGED
@@ -1,94 +1,152 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: accumulators
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.1
4
5
  prerelease:
5
- version: 0.5.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Gavin Heavyside
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-05-23 00:00:00 +01:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-07-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
17
31
  name: rspec
18
- requirement: &id001 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
19
33
  none: false
20
- requirements:
34
+ requirements:
21
35
  - - ~>
22
- - !ruby/object:Gem::Version
23
- version: "2.6"
36
+ - !ruby/object:Gem::Version
37
+ version: '2.8'
24
38
  type: :development
25
39
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.8'
46
+ - !ruby/object:Gem::Dependency
28
47
  name: bundler
29
- requirement: &id002 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
30
49
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "1.0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
35
54
  type: :development
36
55
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - !ruby/object:Gem::Dependency
39
63
  name: jeweler
40
- requirement: &id003 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
41
65
  none: false
42
- requirements:
66
+ requirements:
43
67
  - - ~>
44
- - !ruby/object:Gem::Version
45
- version: "1.6"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.6'
46
70
  type: :development
47
71
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: rcov
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '1.6'
78
+ - !ruby/object:Gem::Dependency
79
+ name: simplecov
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
57
86
  type: :development
58
87
  prerelease: false
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
61
95
  name: guard
62
- requirement: &id005 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
63
97
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: "0"
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
68
102
  type: :development
69
103
  prerelease: false
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
72
111
  name: guard-rspec
73
- requirement: &id006 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
74
121
  none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- version: "0"
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: ruby_gntp
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
79
134
  type: :development
80
135
  prerelease: false
81
- version_requirements: *id006
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
82
142
  description: Statistical accumulators for Ruby
83
143
  email: gavin@heavyside.co.uk
84
144
  executables: []
85
-
86
145
  extensions: []
87
-
88
- extra_rdoc_files:
146
+ extra_rdoc_files:
89
147
  - LICENSE.txt
90
148
  - README.md
91
- files:
149
+ files:
92
150
  - .document
93
151
  - .rspec
94
152
  - Gemfile
@@ -111,36 +169,32 @@ files:
111
169
  - spec/lib/accumulators/min_max_spec.rb
112
170
  - spec/lib/accumulators/sum_spec.rb
113
171
  - spec/spec_helper.rb
114
- has_rdoc: true
115
- homepage: http://github.com/hgavin/accumulators
116
- licenses:
172
+ homepage: http://github.com/gavinheavyside/accumulators
173
+ licenses:
117
174
  - MIT
118
175
  post_install_message:
119
176
  rdoc_options: []
120
-
121
- require_paths:
177
+ require_paths:
122
178
  - lib
123
- required_ruby_version: !ruby/object:Gem::Requirement
179
+ required_ruby_version: !ruby/object:Gem::Requirement
124
180
  none: false
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- hash: -2545635480310131054
129
- segments:
181
+ requirements:
182
+ - - ! '>='
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ segments:
130
186
  - 0
131
- version: "0"
132
- required_rubygems_version: !ruby/object:Gem::Requirement
187
+ hash: 3077237957159155425
188
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
189
  none: false
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: "0"
190
+ requirements:
191
+ - - ! '>='
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
138
194
  requirements: []
139
-
140
195
  rubyforge_project:
141
- rubygems_version: 1.6.2
196
+ rubygems_version: 1.8.23
142
197
  signing_key:
143
198
  specification_version: 3
144
199
  summary: Statistical accumulators for Ruby
145
200
  test_files: []
146
-