map 2.2.2 → 2.3.0
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/lib/map.rb +1 -5
- data/map.gemspec +1 -1
- data/test/map_test.rb +1 -5
- metadata +4 -4
data/lib/map.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Map < Hash
|
2
|
-
Version = '2.
|
2
|
+
Version = '2.3.0' unless defined?(Version)
|
3
3
|
Load = Kernel.method(:load) unless defined?(Load)
|
4
4
|
|
5
5
|
class << Map
|
@@ -607,10 +607,6 @@ class Map < Hash
|
|
607
607
|
end
|
608
608
|
|
609
609
|
def apply(other)
|
610
|
-
dup.apply!(other)
|
611
|
-
end
|
612
|
-
|
613
|
-
def apply!(other)
|
614
610
|
Map.for(other).depth_first_each do |keys, value|
|
615
611
|
set(keys => value) unless !get(keys).nil?
|
616
612
|
end
|
data/map.gemspec
CHANGED
data/test/map_test.rb
CHANGED
@@ -299,11 +299,7 @@ Testing Map do
|
|
299
299
|
m = Map.new(:array => [0, 1], :hash => {:a => false, :b => nil, :c => 42})
|
300
300
|
defaults = Map.new(:array => [nil, nil, 2], :hash => {:b => true})
|
301
301
|
|
302
|
-
|
303
|
-
assert{ applied[:array] == [0,1,2] }
|
304
|
-
assert{ applied[:hash] =~ {:a => false, :b => true, :c => 42} }
|
305
|
-
|
306
|
-
assert{ m.apply!(defaults) }
|
302
|
+
assert{ m.apply(defaults) }
|
307
303
|
assert{ m[:array] == [0,1,2] }
|
308
304
|
assert{ m[:hash] =~ {:a => false, :b => true, :c => 42} }
|
309
305
|
end
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 2.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ara T. Howard
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-31 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|