hashslice 1.1.1 → 1.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd3c1115a5b782548d1af648c321fd9ebc4c204d7ce3f9dcccc1827298ae655a
4
- data.tar.gz: 5ee11ef45c954bead8a727216b66a97d28adfd9fcd4803357e96a29b28c0937a
3
+ metadata.gz: 2eccfcf2e5d663381ed72c26b20e46f692c3de8887a881461191691177963346
4
+ data.tar.gz: 8c407ae1ac1ff17626ea257dd22640b87240179df890f5e70237d53d7822642d
5
5
  SHA512:
6
- metadata.gz: cfaf413036fd76f3e8d737ad648d0c4ed5e861ec306e19515b8a53a3d38b683cc4b3fa99a436ac19208618ac5c8fe4ba756cac818393ea5d497d8bb1cd01f68c
7
- data.tar.gz: bfa467b183aab026397d730da481a57f1813633d01874673592c9dc292277bc526ce2af39dda08115545e531cd49d688fd840074cf59f913f4a9d78ede5d6bd3
6
+ metadata.gz: a54936b67bf3803052b6219ad1bcee5399ec25fe45b0208aa22c9fd6e4100b9e4b2b7205c72fe918cc1a3d3ba8780061cd03a5d9e6c524031a3628cf8a41707d
7
+ data.tar.gz: 676b38b2190fd0e153941ea89faf18c73ab7081bc3fa642fd5bd087d50367575c44500ba30ed1b35485fd94681443236b0a130274e0312343102ebda65ac16f5
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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.
@@ -1,6 +1,6 @@
1
- * CHANGES
2
- * MANIFEST
3
- * README
1
+ * CHANGES.rdoc
2
+ * MANIFEST.rdoc
3
+ * README.rdoc
4
4
  * Rakefile
5
5
  * hashslice.gemspec
6
6
  * certs/djberg96_pub.pem
@@ -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, true)
13
+ Gem::Package.build(spec)
14
14
  end
15
15
 
16
16
  desc "Install the hashslice library as a gem"
@@ -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.1'
5
+ gem.version = '1.1.2'
6
6
  gem.authors = ['Daniel J. Berger', 'Michael Granger']
7
- gem.license = 'Artistic 2.0'
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.
@@ -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.1'.freeze
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
- alias slice []
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.
@@ -14,7 +14,7 @@ class TC_Hashslice < Test::Unit::TestCase
14
14
  end
15
15
 
16
16
  def test_version
17
- assert_equal('1.1.1', Hash::VERSION_HASHSLICE)
17
+ assert_equal('1.1.2', Hash::VERSION_HASHSLICE)
18
18
  assert_true(Hash::VERSION_HASHSLICE.frozen?)
19
19
  end
20
20
 
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.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: 2018-04-05 00:00:00.000000000 Z
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: '0'
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: '0'
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
- - certs
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 2.0
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
- rubyforge_project:
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)