map 6.5.0 → 6.5.1
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/a.rb +22 -0
- data/lib/map.rb +8 -18
- data/map.gemspec +2 -1
- metadata +3 -2
data/a.rb
ADDED
data/lib/map.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
class Map < Hash
|
3
|
-
Version = '6.5.
|
3
|
+
Version = '6.5.1' unless defined?(Version)
|
4
4
|
Load = Kernel.method(:load) unless defined?(Load)
|
5
5
|
|
6
6
|
class << Map
|
@@ -250,15 +250,9 @@ class Map < Hash
|
|
250
250
|
klass.map_for(hash)
|
251
251
|
end
|
252
252
|
|
253
|
-
|
254
|
-
def self.convert_key(key)
|
253
|
+
def Map.convert_key(key)
|
255
254
|
key.kind_of?(Symbol) ? key.to_s : key
|
256
255
|
end
|
257
|
-
=end
|
258
|
-
|
259
|
-
def self.convert_key(key)
|
260
|
-
key = key.kind_of?(Symbol) ? key.to_s : key
|
261
|
-
end
|
262
256
|
|
263
257
|
def convert_key(key)
|
264
258
|
if klass.respond_to?(:convert_key)
|
@@ -472,11 +466,9 @@ class Map < Hash
|
|
472
466
|
|
473
467
|
def unshift(*args)
|
474
468
|
Map.each_pair(*args) do |key, val|
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
keys.unshift(key)
|
479
|
-
end
|
469
|
+
key = convert_key(key)
|
470
|
+
delete(key)
|
471
|
+
keys.unshift(key)
|
480
472
|
__set__(key, val)
|
481
473
|
end
|
482
474
|
self
|
@@ -484,11 +476,9 @@ class Map < Hash
|
|
484
476
|
|
485
477
|
def push(*args)
|
486
478
|
Map.each_pair(*args) do |key, val|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
keys.push(key)
|
491
|
-
end
|
479
|
+
key = convert_key(key)
|
480
|
+
delete(key)
|
481
|
+
keys.push(key)
|
492
482
|
__set__(key, val)
|
493
483
|
end
|
494
484
|
self
|
data/map.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "map"
|
6
|
-
spec.version = "6.5.
|
6
|
+
spec.version = "6.5.1"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "map"
|
9
9
|
spec.description = "description: map kicks the ass"
|
@@ -12,6 +12,7 @@ Gem::Specification::new do |spec|
|
|
12
12
|
["LICENSE",
|
13
13
|
"README",
|
14
14
|
"Rakefile",
|
15
|
+
"a.rb",
|
15
16
|
"lib",
|
16
17
|
"lib/map",
|
17
18
|
"lib/map.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.5.
|
4
|
+
version: 6.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'description: map kicks the ass'
|
15
15
|
email: ara.t.howard@gmail.com
|
@@ -20,6 +20,7 @@ files:
|
|
20
20
|
- LICENSE
|
21
21
|
- README
|
22
22
|
- Rakefile
|
23
|
+
- a.rb
|
23
24
|
- lib/map.rb
|
24
25
|
- lib/map/integrations/active_record.rb
|
25
26
|
- lib/map/options.rb
|