sugar-high 0.4.4.1 → 0.4.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4.1
1
+ 0.4.4.2
@@ -91,7 +91,9 @@ class Array
91
91
  def extract(sym)
92
92
  map { |e| e.send(sym) }
93
93
  end
94
+ end
94
95
 
96
+ module MathArray
95
97
  def sum
96
98
  inject( 0 ) { |sum,x| sum + x }
97
99
  end
@@ -99,7 +101,7 @@ class Array
99
101
  def mean
100
102
  (size > 0) ? sum.to_f / size : 0
101
103
  end
102
- end
104
+ end
103
105
 
104
106
  module FilesArray
105
107
  def delete_all!
@@ -77,19 +77,19 @@ describe "SugarHigh" do
77
77
 
78
78
  describe '#sum' do
79
79
  it "should add elements in array" do
80
- [1, 2, 3].sum.should == 6
80
+ [1, 2, 3].extend(MathArray).sum.should == 6
81
81
  end
82
82
  end
83
83
 
84
84
  describe '#mean' do
85
85
  it "should find mean of elements in array" do
86
- [1, 2, 3].mean.should == 2
86
+ [1, 2, 3].extend(MathArray).mean.should == 2
87
87
  end
88
88
  end
89
89
 
90
90
  describe '#extract' do
91
91
  it "should call method on each element in array" do
92
- ["a", "ab", "abc"].extract(:size).mean.should == 2
92
+ ["a", "ab", "abc"].extract(:size).extend(MathArray).mean.should == 2
93
93
  end
94
94
  end
95
95
 
data/sugar-high.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sugar-high}
8
- s.version = "0.4.4.1"
8
+ s.version = "0.4.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Kristian Mandrup}]
12
- s.date = %q{2011-06-05}
12
+ s.date = %q{2011-06-07}
13
13
  s.description = %q{More Ruby sugar - inspired by the 'zuker' project}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugar-high
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4.1
4
+ version: 0.4.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-05 00:00:00.000000000Z
12
+ date: 2011-06-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &2153188580 !ruby/object:Gem::Requirement
16
+ requirement: &2154025940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.5'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2153188580
24
+ version_requirements: *2154025940
25
25
  description: More Ruby sugar - inspired by the 'zuker' project
26
26
  email: kmandrup@gmail.com
27
27
  executables: []