hashslice 1.0.7 → 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2eccfcf2e5d663381ed72c26b20e46f692c3de8887a881461191691177963346
4
+ data.tar.gz: 8c407ae1ac1ff17626ea257dd22640b87240179df890f5e70237d53d7822642d
5
+ SHA512:
6
+ metadata.gz: a54936b67bf3803052b6219ad1bcee5399ec25fe45b0208aa22c9fd6e4100b9e4b2b7205c72fe918cc1a3d3ba8780061cd03a5d9e6c524031a3628cf8a41707d
7
+ data.tar.gz: 676b38b2190fd0e153941ea89faf18c73ab7081bc3fa642fd5bd087d50367575c44500ba30ed1b35485fd94681443236b0a130274e0312343102ebda65ac16f5
Binary file
Binary file
@@ -1,3 +1,26 @@
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
+
7
+ == 1.1.1 - 5-Apr-2018
8
+ * Fixed deprecation warnings for Ruby 2.4 and later.
9
+ * The VERSION_HASHSLICE constant is now frozen.
10
+ * Updated the cert.
11
+
12
+ == 1.1.0 - 7-Dec-2015
13
+ * This gem is now signed.
14
+ * Updates to the gemspec and Rakefile.
15
+
16
+ == 1.0.9 - 19-Sep-2011
17
+ * Cosmetic updates to silence Ruby 1.9.x warnings.
18
+
19
+ == 1.0.8 - 31-Aug-2011
20
+ * Removed an old install task, updated the clean task and set a
21
+ default task in the Rakefile.
22
+ * Minor updates to the gemspec.
23
+
1
24
  == 1.0.7 - 27-Sep-2009
2
25
  * Fixed a packaging bug.
3
26
  * Minor updates to the gemspec.
@@ -0,0 +1,8 @@
1
+ * CHANGES.rdoc
2
+ * MANIFEST.rdoc
3
+ * README.rdoc
4
+ * Rakefile
5
+ * hashslice.gemspec
6
+ * certs/djberg96_pub.pem
7
+ * lib/hashslice.rb
8
+ * test/test_hashslice.rb
@@ -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
@@ -1,23 +1,28 @@
1
- require 'rake'
2
- require 'rake/clean'
3
- require 'rake/testtask'
4
-
5
- desc "Install the hashslice library (non-gem)"
6
- task :install do
7
- cp 'lib/hashslice.rb', Config::CONFIG['sitelibdir'], :verbose => true
8
- end
9
-
10
- desc 'Build the hashslice gem'
11
- task :gem do
12
- spec = eval(IO.read('hashslice.gemspec'))
13
- Gem::Builder.new(spec).build
14
-
15
- desc "Install the hashslice library as a gem"
16
- task :install_gem => [:gem] do
17
- file = Dir["*.gem"].first
18
- sh "gem install #{file}"
19
-
20
- Rake::TestTask.new do |t|
21
- t.warning = true
22
- t.verbose = true
23
- end
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rake/testtask'
4
+
5
+ CLEAN.include("**/*.gem", "**/*.rbc")
6
+
7
+ namespace :gem do
8
+ desc 'Build the hashslice gem'
9
+ task :create => [:clean] do
10
+ require 'rubygems/package'
11
+ spec = eval(IO.read('hashslice.gemspec'))
12
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
+ Gem::Package.build(spec)
14
+ end
15
+
16
+ desc "Install the hashslice library as a gem"
17
+ task :install => [:create] do
18
+ file = Dir["*.gem"].first
19
+ sh "gem install -l #{file}"
20
+ end
21
+ end
22
+
23
+ Rake::TestTask.new do |t|
24
+ t.warning = true
25
+ t.verbose = true
26
+ end
27
+
28
+ task :default => :test
@@ -0,0 +1,26 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
3
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
5
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
+ bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
7
+ A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
8
+ u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
9
+ 75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
10
+ 6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
11
+ iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
12
+ ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
13
+ 74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
14
+ 058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
15
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
16
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
17
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
18
+ /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
19
+ h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
20
+ 6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
21
+ ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
22
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
23
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
24
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
25
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
26
+ -----END CERTIFICATE-----
@@ -1,25 +1,24 @@
1
1
  require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |gem|
4
- gem.name = 'hashslice'
5
- gem.version = '1.0.7'
6
- gem.authors = ['Daniel J. Berger', 'Michael Granger']
7
- gem.license = 'Artistic 2.0'
8
- gem.email = 'djberg96@gmail.com'
9
- gem.homepage = 'http://www.rubyforge.org/projects/shards'
10
- gem.summary = "Adds hash slicing to Ruby's Hash class"
11
- gem.test_file = 'test/test_hashslice.rb'
12
- gem.has_rdoc = true
13
- gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
4
+ gem.name = 'hashslice'
5
+ gem.version = '1.1.2'
6
+ gem.authors = ['Daniel J. Berger', 'Michael Granger']
7
+ gem.license = 'Artistic-2.0'
8
+ gem.email = 'djberg96@gmail.com'
9
+ gem.homepage = 'http://github.com/djberg96/hashslice'
10
+ gem.summary = "Adds hash slicing to Ruby's Hash class"
11
+ gem.test_file = 'test/test_hashslice.rb'
12
+ gem.files = Dir['**/*'].reject{ |f| f.include?('git') }
13
+ gem.cert_chain = Dir['certs/*']
14
14
 
15
- gem.rubyforge_project = 'shards'
16
- gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
15
+ gem.extra_rdoc_files = ['README.rdoc', 'CHANGES.rdoc', 'MANIFEST.rdoc']
17
16
 
18
- gem.add_development_dependency('test-unit', '>= 2.0.3')
17
+ gem.add_development_dependency('test-unit', '~> 3')
19
18
 
20
- gem.description = <<-EOF
21
- The hashslice library adds builtin hash slicing to Ruby's Hash class.
22
- This lets you reference, or assign to, multiple hash keys simultaneously
23
- via the Hash#[] and Hash#[]= methods, respectively.
24
- EOF
19
+ gem.description = <<-EOF
20
+ The hashslice library adds builtin hash slicing to Ruby's Hash class.
21
+ This lets you reference, or assign to, multiple hash keys simultaneously
22
+ via the Hash#[] and Hash#[]= methods, respectively.
23
+ EOF
25
24
  end
@@ -1,65 +1,72 @@
1
1
  class Hash
2
- alias href []
3
- alias hset []=
4
-
5
- # The version of the hashslice library
6
- VERSION_HASHSLICE = '1.0.7'
2
+ alias href []
3
+ alias hset []=
7
4
 
8
- # Retrieve a hash slice. If a single key is provided, returns a single
9
- # value. If multiple keys are provided, an array of values is returned.
10
- #
11
- # Examples:
12
- #
13
- # hash = {'a' => 1, 'b' => 2, 'c' => 3}
14
- # hash['a'] -> 1
15
- # hash['a', 'c'] -> [1, 3]
16
- #
17
- def [](*args)
18
- if args.length == 1
19
- href(args[0])
20
- else
21
- args.map{ |k| href(k) }
22
- end
23
- end
5
+ # The version of the hashslice library
6
+ VERSION_HASHSLICE = '1.1.2'.freeze
24
7
 
25
- alias slice []
8
+ # Retrieve a hash slice. If a single key is provided, returns a single
9
+ # value. If multiple keys are provided, an array of values is returned.
10
+ #
11
+ # Examples:
12
+ #
13
+ # hash = {'a' => 1, 'b' => 2, 'c' => 3}
14
+ # hash['a'] -> 1
15
+ # hash['a', 'c'] -> [1, 3]
16
+ #
17
+ def [](*args)
18
+ if args.length == 1
19
+ href(args[0])
20
+ else
21
+ args.map{ |k| href(k) }
22
+ end
23
+ end
26
24
 
27
- # Hash slice assignment. You can assign a list of values to a list of keys
28
- # in a single operation on a one for one basis.
29
- #
30
- # If the number of keys exceeds the number of values, the remaining keys
31
- # are assigned a value of nil.
32
- #
33
- # If the number of values exceeds the number of keys, the extra values are
34
- # dropped.
35
- #
36
- # Examples:
37
- #
38
- # hash['a'] = 1, 2 -> {a => [1, 2]}
39
- # hash['a', 'b'] = 3, 4 -> {a => 3, b => 4}
40
- # hash['a', 'b'] = 5 -> {a => 5, b => nil}
41
- # hash['a', 'b'] = 3, 4, 5 -> {a => 3, b => 4}
42
- #
43
- def []=(*args)
44
- if args.length <= 2
45
- hset(*args)
46
- else
47
- values = args.pop # Last arg is the value. The rest are keys.
48
- values = [values] unless values.is_a?(Array)
49
- args.each_index{ |i| hset(args[i], values[i]) }
50
- end
51
- end
52
-
53
- # Returns a sub-hash of the current hash.
54
- #
55
- # Example:
56
- #
57
- # hash = {'a' => 1, 'b' => 2, 'c' => 3}
58
- # hash.hash_of('a', 'b') -> {'a' => 1, 'b' => 2}
59
- #
60
- def hash_of(*args)
61
- temp = {}
62
- args.map{ |k| temp[k] = href(k) }
63
- temp
64
- end
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
33
+
34
+ # Hash slice assignment. You can assign a list of values to a list of keys
35
+ # in a single operation on a one for one basis.
36
+ #
37
+ # If the number of keys exceeds the number of values, the remaining keys
38
+ # are assigned a value of nil.
39
+ #
40
+ # If the number of values exceeds the number of keys, the extra values are
41
+ # dropped.
42
+ #
43
+ # Examples:
44
+ #
45
+ # hash['a'] = 1, 2 -> {a => [1, 2]}
46
+ # hash['a', 'b'] = 3, 4 -> {a => 3, b => 4}
47
+ # hash['a', 'b'] = 5 -> {a => 5, b => nil}
48
+ # hash['a', 'b'] = 3, 4, 5 -> {a => 3, b => 4}
49
+ #
50
+ def []=(*args)
51
+ if args.length <= 2
52
+ hset(*args)
53
+ else
54
+ values = args.pop # Last arg is the value. The rest are keys.
55
+ values = [values] unless values.is_a?(Array)
56
+ args.each_index{ |i| hset(args[i], values[i]) }
57
+ end
58
+ end
59
+
60
+ # Returns a sub-hash of the current hash.
61
+ #
62
+ # Example:
63
+ #
64
+ # hash = {'a' => 1, 'b' => 2, 'c' => 3}
65
+ # hash.hash_of('a', 'b') -> {'a' => 1, 'b' => 2}
66
+ #
67
+ def hash_of(*args)
68
+ temp = {}
69
+ args.map{ |k| temp[k] = href(k) }
70
+ temp
71
+ end
65
72
  end
@@ -5,91 +5,90 @@
5
5
  # via the 'rake test' task.
6
6
  #######################################################################
7
7
  require 'rubygems'
8
- gem 'test-unit'
9
-
10
8
  require 'hashslice'
11
- require 'test/unit'
9
+ require 'test-unit'
12
10
 
13
11
  class TC_Hashslice < Test::Unit::TestCase
14
- def setup
15
- @hash = {'a' => 1, 'b' => 2}
16
- end
12
+ def setup
13
+ @hash = {'a' => 1, 'b' => 2}
14
+ end
15
+
16
+ def test_version
17
+ assert_equal('1.1.2', Hash::VERSION_HASHSLICE)
18
+ assert_true(Hash::VERSION_HASHSLICE.frozen?)
19
+ end
20
+
21
+ def test_get_slice_instance_method_basic
22
+ assert_respond_to(@hash, :[])
23
+ assert_nothing_raised{ @hash['a'] }
24
+ assert_nothing_raised{ @hash['a', 'b'] }
25
+ assert_kind_of(Integer, @hash['a'])
26
+ assert_kind_of(Array, @hash['a', 'b'])
27
+ end
17
28
 
18
- def test_version
19
- assert_equal('1.0.7', Hash::VERSION_HASHSLICE)
20
- end
21
-
22
- def test_get_slice_instance_method_basic
23
- assert_respond_to(@hash, :[])
24
- assert_nothing_raised{ @hash['a'] }
25
- assert_nothing_raised{ @hash['a', 'b'] }
26
- assert_kind_of(Integer, @hash['a'])
27
- assert_kind_of(Array, @hash['a', 'b'])
28
- end
29
+ def test_get_slice_instance_method
30
+ assert_equal(1, @hash['a'])
31
+ assert_equal([1, 2], @hash['a', 'b'])
32
+ assert_equal([1, 2, nil], @hash['a', 'b', 'c'])
33
+ assert_nil(@hash['bogus'])
34
+ end
29
35
 
30
- def test_get_slice_instance_method
31
- assert_equal(1, @hash['a'])
32
- assert_equal([1, 2], @hash['a', 'b'])
33
- assert_equal([1, 2, nil], @hash['a', 'b', 'c'])
34
- assert_nil(@hash['bogus'])
35
- end
36
+ def test_get_slice_duplicate_keys
37
+ assert_equal([1, 1], @hash['a', 'a'])
38
+ assert_equal([1, 2, 1, 2], @hash['a', 'b', 'a', 'b'])
39
+ end
36
40
 
37
- def test_get_slice_duplicate_keys
38
- assert_equal([1, 1], @hash['a', 'a'])
39
- assert_equal([1, 2, 1, 2], @hash['a', 'b', 'a', 'b'])
40
- end
41
+ def test_set_slice_instance_method_basic
42
+ assert_respond_to(@hash, :[]=)
43
+ assert_nothing_raised{ @hash['a'] = 3 }
44
+ assert_nothing_raised{ @hash['a', 'b'] = 3 }
45
+ assert_nothing_raised{ @hash['a', 'b'] = 3, 4 }
46
+ assert_kind_of(Integer, @hash['a'] = 3)
47
+ assert_kind_of(Integer, @hash['a', 'b'] = 3)
48
+ assert_kind_of(Integer, @hash['a', 'b'] = 3, 4)
49
+ end
41
50
 
42
- def test_set_slice_instance_method_basic
43
- assert_respond_to(@hash, :[]=)
44
- assert_nothing_raised{ @hash['a'] = 3 }
45
- assert_nothing_raised{ @hash['a', 'b'] = 3 }
46
- assert_nothing_raised{ @hash['a', 'b'] = 3, 4 }
47
- assert_kind_of(Fixnum, @hash['a'] = 3)
48
- assert_kind_of(Fixnum, @hash['a', 'b'] = 3)
49
- assert_kind_of(Fixnum, @hash['a', 'b'] = 3, 4)
50
- end
51
+ # hash[key] = value
52
+ def test_set_slice_instance_method_single_key_and_value
53
+ assert_nothing_raised{ @hash['a'] = 3 }
54
+ assert_nothing_raised{ @hash['b'] = [1, 2] }
55
+ assert_equal({'a' => 3, 'b' => [1, 2]}, @hash)
56
+ end
51
57
 
52
- # hash[key] = value
53
- def test_set_slice_instance_method_single_key_and_value
54
- assert_nothing_raised{ @hash['a'] = 3 }
55
- assert_nothing_raised{ @hash['b'] = [1, 2] }
56
- assert_equal({'a' => 3, 'b' => [1, 2]}, @hash)
57
- end
58
+ # hash[key1, key2] = value
59
+ def test_set_slice_instance_method_multiple_keys_single_value
60
+ assert_nothing_raised{ @hash['a', 'b'] = 3 }
61
+ assert_equal({'a' => 3, 'b' => nil}, @hash)
62
+ end
58
63
 
59
- # hash[key1, key2] = value
60
- def test_set_slice_instance_method_multiple_keys_single_value
61
- assert_nothing_raised{ @hash['a', 'b'] = 3 }
62
- assert_equal({'a' => 3, 'b' => nil}, @hash)
63
- end
64
+ # hash[key1, key2] = value1, value2
65
+ def test_set_slice_instance_method_multiple_keys_multiple_values
66
+ assert_nothing_raised{ @hash['a', 'b'] = 3, 4 }
67
+ assert_equal({'a' => 3, 'b' => 4}, @hash)
68
+ end
64
69
 
65
- # hash[key1, key2] = value1, value2
66
- def test_set_slice_instance_method_multiple_keys_multiple_values
67
- assert_nothing_raised{ @hash['a', 'b'] = 3, 4 }
68
- assert_equal({'a' => 3, 'b' => 4}, @hash)
69
- end
70
+ # hash[key] = value1, value2
71
+ def test_set_slice_instance_method_single_key_multiple_values
72
+ assert_nothing_raised{ @hash['a'] = 3, 4 }
73
+ assert_equal({'a' => [3, 4], 'b' => 2}, @hash)
74
+ end
70
75
 
71
- # hash[key] = value1, value2
72
- def test_set_slice_instance_method_single_key_multiple_values
73
- assert_nothing_raised{ @hash['a'] = 3, 4 }
74
- assert_equal({'a' => [3, 4], 'b' => 2}, @hash)
75
- end
76
+ # hash[key1, key2] = value1, value2, value3
77
+ def test_set_slice_instance_method_multiple_keys_odd_values
78
+ assert_nothing_raised{ @hash['a', 'b'] = 3, 4, 5 }
79
+ assert_equal({'a' => 3, 'b' => 4}, @hash)
80
+ end
76
81
 
77
- # hash[key1, key2] = value1, value2, value3
78
- def test_set_slice_instance_method_multiple_keys_odd_values
79
- assert_nothing_raised{ @hash['a', 'b'] = 3, 4, 5 }
80
- assert_equal({'a' => 3, 'b' => 4}, @hash)
81
- end
82
+ def test_slice_alias
83
+ assert_true(Hash.instance_method(:slice) == Hash.instance_method(:[]))
84
+ end
82
85
 
83
- def test_slice_alias
84
- assert_true(Hash.instance_method(:slice) == Hash.instance_method(:[]))
85
- end
86
-
87
- def test_hash_of
88
- assert_respond_to(@hash, :hash_of)
89
- assert_equal({'a' => 1, 'b' => 2}, @hash.hash_of('a', 'b'))
90
- end
86
+ def test_hash_of
87
+ assert_respond_to(@hash, :hash_of)
88
+ assert_equal({'a' => 1, 'b' => 2}, @hash.hash_of('a', 'b'))
89
+ end
91
90
 
92
- def teardown
93
- @hash = nil
94
- end
91
+ def teardown
92
+ @hash = nil
93
+ end
95
94
  end
metadata CHANGED
@@ -1,73 +1,99 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hashslice
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.7
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Daniel J. Berger
8
8
  - Michael Granger
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
12
-
13
- date: 2009-09-27 00:00:00 -06:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
15
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
16
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
17
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
18
+ bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
19
+ A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
20
+ u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
21
+ 75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
22
+ 6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
23
+ iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
24
+ ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
25
+ 74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
26
+ 058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
27
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
28
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
29
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
30
+ /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
31
+ h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
32
+ 6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
33
+ ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
34
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
35
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
36
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
37
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
38
+ -----END CERTIFICATE-----
39
+ date: 2020-07-14 00:00:00.000000000 Z
40
+ dependencies:
41
+ - !ruby/object:Gem::Dependency
17
42
  name: test-unit
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
18
48
  type: :development
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: 2.0.3
25
- version:
26
- description: " The hashslice library adds builtin hash slicing to Ruby's Hash class.\n This lets you reference, or assign to, multiple hash keys simultaneously\n via the Hash#[] and Hash#[]= methods, respectively.\n"
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
55
+ description: |2
56
+ The hashslice library adds builtin hash slicing to Ruby's Hash class.
57
+ This lets you reference, or assign to, multiple hash keys simultaneously
58
+ via the Hash#[] and Hash#[]= methods, respectively.
27
59
  email: djberg96@gmail.com
28
60
  executables: []
29
-
30
61
  extensions: []
31
-
32
- extra_rdoc_files:
33
- - README
34
- - CHANGES
35
- - MANIFEST
36
- files:
37
- - CHANGES
62
+ extra_rdoc_files:
63
+ - README.rdoc
64
+ - CHANGES.rdoc
65
+ - MANIFEST.rdoc
66
+ files:
67
+ - CHANGES.rdoc
68
+ - MANIFEST.rdoc
69
+ - README.rdoc
70
+ - Rakefile
71
+ - certs/djberg96_pub.pem
38
72
  - hashslice.gemspec
39
73
  - lib/hashslice.rb
40
- - MANIFEST
41
- - Rakefile
42
- - README
43
74
  - test/test_hashslice.rb
44
- has_rdoc: true
45
- homepage: http://www.rubyforge.org/projects/shards
46
- licenses:
47
- - Artistic 2.0
75
+ homepage: http://github.com/djberg96/hashslice
76
+ licenses:
77
+ - Artistic-2.0
78
+ metadata: {}
48
79
  post_install_message:
49
80
  rdoc_options: []
50
-
51
- require_paths:
81
+ require_paths:
52
82
  - lib
53
- required_ruby_version: !ruby/object:Gem::Requirement
54
- requirements:
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
55
85
  - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
58
- version:
59
- required_rubygems_version: !ruby/object:Gem::Requirement
60
- requirements:
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
61
90
  - - ">="
62
- - !ruby/object:Gem::Version
63
- version: "0"
64
- version:
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
65
93
  requirements: []
66
-
67
- rubyforge_project: shards
68
- rubygems_version: 1.3.5
94
+ rubygems_version: 3.0.3
69
95
  signing_key:
70
- specification_version: 3
96
+ specification_version: 4
71
97
  summary: Adds hash slicing to Ruby's Hash class
72
- test_files:
98
+ test_files:
73
99
  - test/test_hashslice.rb
Binary file
data/MANIFEST DELETED
@@ -1,7 +0,0 @@
1
- * CHANGES
2
- * MANIFEST
3
- * README
4
- * Rakefile
5
- * hashslice.gemspec
6
- * lib/hashslice.rb
7
- * test/test_hashslice.rb
data/README DELETED
@@ -1,50 +0,0 @@
1
- = Description
2
- Slicing for Ruby hashes.
3
-
4
- = Installation
5
- rake test (optional)
6
- rake install
7
-
8
- = Synopsis
9
- require 'hashslice'
10
-
11
- hash = {'a' => 1, 'b' => 2, 'c' => 3}
12
-
13
- # Slice reference
14
- hash['a', 'b'] # -> [1, 2]
15
- hash['a'] # -> 1
16
-
17
- # Slice assignment
18
- hash['a', 'b'] = 7, 8
19
-
20
- hash # -> {'a' => 7, 'b' => 8, 'c' => 3}
21
-
22
- # Sub hash
23
- hash.hash_of('a', 'b') # -> {'a' => 1, 'b' => 2}
24
-
25
- = Overview
26
- This library modifies the Hash#[] and Hash#[]= methods so that they can
27
- handle list reference or assignment. It also adds the Hash#hash_of method
28
- that returns a hash slice.
29
-
30
- == Hash#[*keys]
31
- If more than one key is provided then an array is returned. Single
32
- keys work as before, i.e. they return a single value.
33
-
34
- == Hash#[*keys]=(*values)
35
- The values on the right are assigned to the keys on left on a one for one
36
- If there are more values than keys, the extra values are dropped.
37
-
38
- = Copyright
39
- Copyright (c) 2001-2009, The FaerieMUD Consortium and Daniel J. Berger.
40
- All rights reserved.
41
-
42
- = License
43
- This module is free software. You may use, modify, and/or redistribute this
44
- software under the terms of the Artistic License 2.0
45
-
46
- http://www.perlfoundation.org/artistic_license_2_0
47
-
48
- = Authors
49
- Michael Granger (original author)
50
- Daniel Berger (current maintainer)