kim 0.0.8 → 0.0.9

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/README CHANGED
@@ -24,3 +24,11 @@ Fixnum
24
24
  ### sign
25
25
 
26
26
  Returns 1 or -1 matching the sign of the current fixnum
27
+
28
+ Array
29
+ _____
30
+
31
+ ### all_equal?
32
+
33
+ Return true if all the items of the array are equal
34
+ Note: an empty array will solve to true while i'm unsure it's desired behavior
data/README.md CHANGED
@@ -24,3 +24,11 @@ Fixnum
24
24
  ### sign
25
25
 
26
26
  Returns 1 or -1 matching the sign of the current fixnum
27
+
28
+ Array
29
+ _____
30
+
31
+ ### all_equal?
32
+
33
+ Return true if all the items of the array are equal
34
+ Note: an empty array will solve to true while i'm unsure it's desired behavior
data/lib/kim.rb CHANGED
@@ -2,3 +2,4 @@ require "kim/version"
2
2
 
3
3
  require "kim/hash"
4
4
  require "kim/fixnum"
5
+ require "kim/array"
data/lib/kim/array.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Array
2
+ def all_equal?
3
+ self.all?{|item| item == self.first}
4
+ end
5
+ end
data/lib/kim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kim
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -0,0 +1,10 @@
1
+ describe Array do
2
+ it "should return the right response for all equal" do
3
+ [ 1, 1, 1, 1 ].should be_all_equal
4
+ [ 1, 2, 1, 1 ].should_not be_all_equal
5
+ end
6
+
7
+ it "should return all equal when empty?" do
8
+ [].should be_all_equal
9
+ end
10
+ end
File without changes
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kim
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Giancarlo Palavicini
@@ -49,10 +49,12 @@ files:
49
49
  - Rakefile
50
50
  - kim.gemspec
51
51
  - lib/kim.rb
52
+ - lib/kim/array.rb
52
53
  - lib/kim/fixnum.rb
53
54
  - lib/kim/hash.rb
54
55
  - lib/kim/version.rb
55
- - spec/hash/fixnum_spec.rb
56
+ - spec/array/array_spec.rb
57
+ - spec/fixnum/fixnum_spec.rb
56
58
  - spec/hash/hash_spec.rb
57
59
  - spec/spec_helper.rb
58
60
  homepage: ""
@@ -89,6 +91,7 @@ signing_key:
89
91
  specification_version: 3
90
92
  summary: Improvements to several Ruby classes
91
93
  test_files:
92
- - spec/hash/fixnum_spec.rb
94
+ - spec/array/array_spec.rb
95
+ - spec/fixnum/fixnum_spec.rb
93
96
  - spec/hash/hash_spec.rb
94
97
  - spec/spec_helper.rb