guerrilla_patch 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.3.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "guerrilla_patch"
8
- s.version = "2.3.0"
8
+ s.version = "2.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["drKreso"]
12
- s.date = "2012-03-30"
12
+ s.date = "2012-03-31"
13
13
  s.description = "I am tierd of hunting down monkey patches at large. Caging them inside this gem"
14
14
  s.email = "kresimir.bojcic@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -40,17 +40,11 @@ module Kernel
40
40
  @result << Kernel.when_present(item, &block).to_s
41
41
  end
42
42
  end
43
-
43
+ end
44
44
 
45
45
  #add sum to array, with or without name
46
46
  class Array
47
- def sum
48
- self.reduce(0, :+)
49
- end
50
-
51
- def sum(name)
47
+ def sum(name = nil)
52
48
  self.map(&name).reduce(0, :+)
53
49
  end
54
50
  end
55
-
56
- end
@@ -63,6 +63,24 @@ describe Kernel do
63
63
 
64
64
  end
65
65
 
66
+ end
66
67
 
68
+ describe Array do
69
+ it 'should know how to sum basic array' do
70
+ [1,2,3].sum.should == 6
71
+ end
72
+
73
+ it 'should handle the zero elements case' do
74
+ [].sum.should == 0
75
+ end
76
+
77
+ it 'can sum by name' do
78
+ apple = stub(:price => 100)
79
+ orange = stub(:price => 200)
80
+ [apple, orange].sum(:price).should == 300
81
+ end
67
82
 
68
83
  end
84
+
85
+
86
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guerrilla_patch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
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: 2012-03-30 00:00:00.000000000Z
12
+ date: 2012-03-31 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70175837289120 !ruby/object:Gem::Requirement
16
+ requirement: &70151526324440 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.8.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70175837289120
24
+ version_requirements: *70151526324440
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70175837288240 !ruby/object:Gem::Requirement
27
+ requirement: &70151526323620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70175837288240
35
+ version_requirements: *70151526323620
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &70175837287740 !ruby/object:Gem::Requirement
38
+ requirement: &70151526323120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.4
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70175837287740
46
+ version_requirements: *70151526323120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &70175837287240 !ruby/object:Gem::Requirement
49
+ requirement: &70151526322480 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70175837287240
57
+ version_requirements: *70151526322480
58
58
  description: I am tierd of hunting down monkey patches at large. Caging them inside
59
59
  this gem
60
60
  email: kresimir.bojcic@gmail.com
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: -165187637556337306
96
+ hash: -4420222654873415163
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements: