hashslice 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/{CHANGES → CHANGES.rdoc} +6 -0
- data/{MANIFEST → MANIFEST.rdoc} +3 -3
- data/README.rdoc +49 -0
- data/Rakefile +1 -1
- data/hashslice.gemspec +4 -4
- data/lib/hashslice.rb +9 -2
- data/test/test_hashslice.rb +1 -1
- metadata +15 -19
- metadata.gz.sig +0 -0
- data/README +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eccfcf2e5d663381ed72c26b20e46f692c3de8887a881461191691177963346
|
4
|
+
data.tar.gz: 8c407ae1ac1ff17626ea257dd22640b87240179df890f5e70237d53d7822642d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a54936b67bf3803052b6219ad1bcee5399ec25fe45b0208aa22c9fd6e4100b9e4b2b7205c72fe918cc1a3d3ba8780061cd03a5d9e6c524031a3628cf8a41707d
|
7
|
+
data.tar.gz: 676b38b2190fd0e153941ea89faf18c73ab7081bc3fa642fd5bd087d50367575c44500ba30ed1b35485fd94681443236b0a130274e0312343102ebda65ac16f5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/{CHANGES → CHANGES.rdoc}
RENAMED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.1.2 - 14-Jul-2020
|
2
|
+
* Now silences the redefinition warning.
|
3
|
+
* Fix the license name in the gemspec (missing hyphen).
|
4
|
+
* Add an explicit .rdoc extension to the README, MANIFEST and CHANGES files.
|
5
|
+
* Added a loose dependency (version 3+) to the test-unit development dependency.
|
6
|
+
|
1
7
|
== 1.1.1 - 5-Apr-2018
|
2
8
|
* Fixed deprecation warnings for Ruby 2.4 and later.
|
3
9
|
* The VERSION_HASHSLICE constant is now frozen.
|
data/{MANIFEST → MANIFEST.rdoc}
RENAMED
data/README.rdoc
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
= Description
|
2
|
+
Slicing for Ruby hashes.
|
3
|
+
|
4
|
+
= Installation
|
5
|
+
gem install hashslice
|
6
|
+
|
7
|
+
= Synopsis
|
8
|
+
require 'hashslice'
|
9
|
+
|
10
|
+
hash = {'a' => 1, 'b' => 2, 'c' => 3}
|
11
|
+
|
12
|
+
# Slice reference
|
13
|
+
hash['a', 'b'] # -> [1, 2]
|
14
|
+
hash['a'] # -> 1
|
15
|
+
|
16
|
+
# Slice assignment
|
17
|
+
hash['a', 'b'] = 7, 8
|
18
|
+
|
19
|
+
hash # -> {'a' => 7, 'b' => 8, 'c' => 3}
|
20
|
+
|
21
|
+
# Sub hash
|
22
|
+
hash.hash_of('a', 'b') # -> {'a' => 1, 'b' => 2}
|
23
|
+
|
24
|
+
= Overview
|
25
|
+
This library modifies the Hash#[] and Hash#[]= methods so that they can
|
26
|
+
handle list reference or assignment. It also adds the Hash#hash_of method
|
27
|
+
that returns a hash slice.
|
28
|
+
|
29
|
+
== Hash#[*keys]
|
30
|
+
If more than one key is provided then an array is returned. Single
|
31
|
+
keys work as before, i.e. they return a single value.
|
32
|
+
|
33
|
+
== Hash#[*keys]=(*values)
|
34
|
+
The values on the right are assigned to the keys on left on a one for one
|
35
|
+
If there are more values than keys, the extra values are dropped.
|
36
|
+
|
37
|
+
= Copyright
|
38
|
+
Copyright (c) 2001-2020, The FaerieMUD Consortium and Daniel J. Berger.
|
39
|
+
All rights reserved.
|
40
|
+
|
41
|
+
= License
|
42
|
+
This module is free software. You may use, modify, and/or redistribute this
|
43
|
+
software under the terms of the Artistic License 2.0
|
44
|
+
|
45
|
+
http://www.perlfoundation.org/artistic_license_2_0
|
46
|
+
|
47
|
+
= Authors
|
48
|
+
* Michael Granger (original author)
|
49
|
+
* Daniel Berger (current maintainer)
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ namespace :gem do
|
|
10
10
|
require 'rubygems/package'
|
11
11
|
spec = eval(IO.read('hashslice.gemspec'))
|
12
12
|
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
13
|
-
Gem::Package.build(spec
|
13
|
+
Gem::Package.build(spec)
|
14
14
|
end
|
15
15
|
|
16
16
|
desc "Install the hashslice library as a gem"
|
data/hashslice.gemspec
CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'hashslice'
|
5
|
-
gem.version = '1.1.
|
5
|
+
gem.version = '1.1.2'
|
6
6
|
gem.authors = ['Daniel J. Berger', 'Michael Granger']
|
7
|
-
gem.license = 'Artistic
|
7
|
+
gem.license = 'Artistic-2.0'
|
8
8
|
gem.email = 'djberg96@gmail.com'
|
9
9
|
gem.homepage = 'http://github.com/djberg96/hashslice'
|
10
10
|
gem.summary = "Adds hash slicing to Ruby's Hash class"
|
@@ -12,9 +12,9 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
gem.cert_chain = Dir['certs/*']
|
14
14
|
|
15
|
-
gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
15
|
+
gem.extra_rdoc_files = ['README.rdoc', 'CHANGES.rdoc', 'MANIFEST.rdoc']
|
16
16
|
|
17
|
-
gem.add_development_dependency('test-unit')
|
17
|
+
gem.add_development_dependency('test-unit', '~> 3')
|
18
18
|
|
19
19
|
gem.description = <<-EOF
|
20
20
|
The hashslice library adds builtin hash slicing to Ruby's Hash class.
|
data/lib/hashslice.rb
CHANGED
@@ -3,7 +3,7 @@ class Hash
|
|
3
3
|
alias hset []=
|
4
4
|
|
5
5
|
# The version of the hashslice library
|
6
|
-
VERSION_HASHSLICE = '1.1.
|
6
|
+
VERSION_HASHSLICE = '1.1.2'.freeze
|
7
7
|
|
8
8
|
# Retrieve a hash slice. If a single key is provided, returns a single
|
9
9
|
# value. If multiple keys are provided, an array of values is returned.
|
@@ -22,7 +22,14 @@ class Hash
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
# Temporarily silence redefinition warning.
|
26
|
+
begin
|
27
|
+
old_verbose = $VERBOSE
|
28
|
+
$VERBOSE = false
|
29
|
+
alias slice []
|
30
|
+
ensure
|
31
|
+
$VERBOSE = old_verbose
|
32
|
+
end
|
26
33
|
|
27
34
|
# Hash slice assignment. You can assign a list of values to a list of keys
|
28
35
|
# in a single operation on a one for one basis.
|
data/test/test_hashslice.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashslice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -36,22 +36,22 @@ cert_chain:
|
|
36
36
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
37
37
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date:
|
39
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: test-unit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3'
|
55
55
|
description: |2
|
56
56
|
The hashslice library adds builtin hash slicing to Ruby's Hash class.
|
57
57
|
This lets you reference, or assign to, multiple hash keys simultaneously
|
@@ -60,24 +60,21 @@ email: djberg96@gmail.com
|
|
60
60
|
executables: []
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files:
|
63
|
-
- README
|
64
|
-
- CHANGES
|
65
|
-
- MANIFEST
|
63
|
+
- README.rdoc
|
64
|
+
- CHANGES.rdoc
|
65
|
+
- MANIFEST.rdoc
|
66
66
|
files:
|
67
|
-
-
|
67
|
+
- CHANGES.rdoc
|
68
|
+
- MANIFEST.rdoc
|
69
|
+
- README.rdoc
|
70
|
+
- Rakefile
|
68
71
|
- certs/djberg96_pub.pem
|
69
|
-
- CHANGES
|
70
72
|
- hashslice.gemspec
|
71
|
-
- lib
|
72
73
|
- lib/hashslice.rb
|
73
|
-
- MANIFEST
|
74
|
-
- Rakefile
|
75
|
-
- README
|
76
|
-
- test
|
77
74
|
- test/test_hashslice.rb
|
78
75
|
homepage: http://github.com/djberg96/hashslice
|
79
76
|
licenses:
|
80
|
-
- Artistic
|
77
|
+
- Artistic-2.0
|
81
78
|
metadata: {}
|
82
79
|
post_install_message:
|
83
80
|
rdoc_options: []
|
@@ -94,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
91
|
- !ruby/object:Gem::Version
|
95
92
|
version: '0'
|
96
93
|
requirements: []
|
97
|
-
|
98
|
-
rubygems_version: 2.7.6
|
94
|
+
rubygems_version: 3.0.3
|
99
95
|
signing_key:
|
100
96
|
specification_version: 4
|
101
97
|
summary: Adds hash slicing to Ruby's Hash class
|
metadata.gz.sig
CHANGED
Binary file
|
data/README
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
= Description
|
2
|
-
Slicing for Ruby hashes.
|
3
|
-
|
4
|
-
= Installation
|
5
|
-
gem install hashslice
|
6
|
-
|
7
|
-
= Synopsis
|
8
|
-
require 'hashslice'
|
9
|
-
|
10
|
-
hash = {'a' => 1, 'b' => 2, 'c' => 3}
|
11
|
-
|
12
|
-
# Slice reference
|
13
|
-
hash['a', 'b'] # -> [1, 2]
|
14
|
-
hash['a'] # -> 1
|
15
|
-
|
16
|
-
# Slice assignment
|
17
|
-
hash['a', 'b'] = 7, 8
|
18
|
-
|
19
|
-
hash # -> {'a' => 7, 'b' => 8, 'c' => 3}
|
20
|
-
|
21
|
-
# Sub hash
|
22
|
-
hash.hash_of('a', 'b') # -> {'a' => 1, 'b' => 2}
|
23
|
-
|
24
|
-
= Overview
|
25
|
-
This library modifies the Hash#[] and Hash#[]= methods so that they can
|
26
|
-
handle list reference or assignment. It also adds the Hash#hash_of method
|
27
|
-
that returns a hash slice.
|
28
|
-
|
29
|
-
== Hash#[*keys]
|
30
|
-
If more than one key is provided then an array is returned. Single
|
31
|
-
keys work as before, i.e. they return a single value.
|
32
|
-
|
33
|
-
== Hash#[*keys]=(*values)
|
34
|
-
The values on the right are assigned to the keys on left on a one for one
|
35
|
-
If there are more values than keys, the extra values are dropped.
|
36
|
-
|
37
|
-
= Copyright
|
38
|
-
Copyright (c) 2001-2018, The FaerieMUD Consortium and Daniel J. Berger.
|
39
|
-
All rights reserved.
|
40
|
-
|
41
|
-
= License
|
42
|
-
This module is free software. You may use, modify, and/or redistribute this
|
43
|
-
software under the terms of the Artistic License 2.0
|
44
|
-
|
45
|
-
http://www.perlfoundation.org/artistic_license_2_0
|
46
|
-
|
47
|
-
= Authors
|
48
|
-
Michael Granger (original author)
|
49
|
-
Daniel Berger (current maintainer)
|