kim 0.0.6 → 0.0.7

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/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .*.sw?
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --require ./spec/spec_helper.rb
2
+ --color
data/kim.gemspec CHANGED
@@ -17,4 +17,6 @@ Gem::Specification.new do |s|
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
+
21
+ s.add_development_dependency 'rspec'
20
22
  end
data/lib/kim/hash.rb CHANGED
@@ -8,7 +8,7 @@ module Kim
8
8
  if has_key? key and result[key].is_a? Hash and value.is_a? Hash
9
9
  { key => result[key].deep_merge(value) }
10
10
  else
11
- other
11
+ { key => value }
12
12
  end
13
13
  )
14
14
  end
data/lib/kim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kim
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -0,0 +1,15 @@
1
+ describe "Hash Additions" do
2
+ it "should add deep_merge method to Hash" do
3
+ {}.should respond_to :deep_merge
4
+ end
5
+ it "should replace top most entries" do
6
+ {:a=>{:b=>:c}}.deep_merge({:a=>{:b=>:d}}).should == {:a=>{:b=>:d}}
7
+ end
8
+ it "should merge top most hash" do
9
+ {:a=>{:b=>:c}}.deep_merge({:a=>{:d=>:e}}).should == {:a=>{:b=>:c, :d => :e}}
10
+ end
11
+
12
+ it "should merge a key only exists in other" do
13
+ {:a => {:aa => :c}}.deep_merge({:a=> {:ab => :c}, :b => {:ba => :c}}).should == {:a=> {:aa => :c, :ab => :c}, :b => {:ba => :c}}
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ # require 'bundler/setup'
3
+ require 'kim'
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Giancarlo Palavicini
@@ -15,9 +15,22 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-31 00:00:00 Z
19
- dependencies: []
20
-
18
+ date: 2011-09-02 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :development
33
+ version_requirements: *id001
21
34
  description: Handy additions to various ruby classes
22
35
  email:
23
36
  - kasthor@kasthor.com
@@ -29,6 +42,7 @@ extra_rdoc_files: []
29
42
 
30
43
  files:
31
44
  - .gitignore
45
+ - .rspec
32
46
  - Gemfile
33
47
  - README
34
48
  - README.md
@@ -37,6 +51,8 @@ files:
37
51
  - lib/kim.rb
38
52
  - lib/kim/hash.rb
39
53
  - lib/kim/version.rb
54
+ - spec/hash/hash_spec.rb
55
+ - spec/spec_helper.rb
40
56
  homepage: ""
41
57
  licenses: []
42
58
 
@@ -70,5 +86,6 @@ rubygems_version: 1.8.7
70
86
  signing_key:
71
87
  specification_version: 3
72
88
  summary: Improvements to several Ruby classes
73
- test_files: []
74
-
89
+ test_files:
90
+ - spec/hash/hash_spec.rb
91
+ - spec/spec_helper.rb