hash-to_proc 0.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d9cccf09c15444b6d1cfceab2602f2960445bf54
4
+ data.tar.gz: 83ea6eabcefdb0530cb119659274c353e0b9b1e9
5
+ SHA512:
6
+ metadata.gz: 581e3618c28b6891e3e10fac289a2c2bd1f4703b2c3f9f740890cd1eed4ac37b7449624b006cda1eca0d7d2bc07e0fd9befff87f84c99cf5efe86e7c2185257a
7
+ data.tar.gz: dd3e2d537230ebbd621f26dac66296390193640d9b471d5152f444dfee4e863c0f718382990dbbb1931a6c23a0853fc23cf824ecb7242548a15cacf062d7e770
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
data/COPYING ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Hash#to_proc
2
+
3
+ Hash#to_proc for Ruby 2.2 or earlier.
@@ -0,0 +1,27 @@
1
+ # -*- coding: us-ascii -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "hash-to_proc"
5
+ s.version = "0.0.1"
6
+ s.authors = ["Nobu Nakada"]
7
+ s.email = ["nobu@ruby-lang.org"]
8
+ s.summary = "Hash#to_proc for older Ruby"
9
+ s.description = "Hash#to_proc which has been added to Ruby 2.3 for older Ruby."
10
+ s.homepage = "https://github.com/nobu/hash-to_proc"
11
+ s.license = "BSD-2-Clause"
12
+ s.cert_chain = %w[certs/nobu.pem]
13
+ s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
14
+
15
+ s.files = %w[
16
+ COPYING
17
+ README.md
18
+ hash-to_proc.gemspec
19
+ lib/hash/to_proc.rb
20
+ test/test_hash_to_proc.rb
21
+ ]
22
+
23
+ s.test_files = s.files.grep(/\Atest\//)
24
+ s.require_paths = ["lib"]
25
+
26
+ s.required_ruby_version = ">= 2.0.0"
27
+ end
@@ -0,0 +1,9 @@
1
+ # -*- coding: us-ascii -*-
2
+
3
+ class Hash
4
+ unless method_defined?(:to_proc)
5
+ def to_proc
6
+ method(:[]).to_proc
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ # -*- coding: us-ascii -*-
2
+
3
+ require 'test/unit'
4
+ require_relative '../lib/hash/to_proc'
5
+
6
+ class TestHash < Test::Unit::TestCase
7
+ def test_to_proc
8
+ h = {
9
+ 1 => 10,
10
+ 2 => 20,
11
+ 3 => 30,
12
+ }
13
+
14
+ assert_equal([10, 20, 30], [1, 2, 3].map(&h))
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hash-to_proc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nobu Nakada
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ0wCwYDVQQDDARub2J1
14
+ MRkwFwYKCZImiZPyLGQBGRYJcnVieS1sYW5nMRMwEQYKCZImiZPyLGQBGRYDb3Jn
15
+ MB4XDTE1MTIyMjEzNDAyOFoXDTE2MTIyMTEzNDAyOFowPzENMAsGA1UEAwwEbm9i
16
+ dTEZMBcGCgmSJomT8ixkARkWCXJ1YnktbGFuZzETMBEGCgmSJomT8ixkARkWA29y
17
+ ZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANduwQ8upTFS4aOBPQQ0
18
+ 2aRqo8otV3QgKRNy3DYwL2ugeZ4F/wAk3KdVeXnDW2Hkj9Yv33FLUKytq9QuhaG4
19
+ 3LmKnVWVbr+G0w/qtv8BIH5w9ajq89YI4X6+fOLasfHXHe/GzPW8siEszFqfEVLi
20
+ LrwipHxurRmiKR4/CyeMTbIaeS2guK1Srj1UCM71OuA18PdbPx+nnZGDRJj6satU
21
+ f3cRPJZdGntrl8ZddzYmkhDK+i7GxbnxMCxw1j3GOhkPXdwy95l3nkuU18kv/Cqn
22
+ QJvmgWgwPtH7ytuhnkIa9cgB44SKGYPvMoWrYaEPjv3v33TPk72vK6WQG1MiykxK
23
+ pHMCAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFNNR
24
+ 10GwXP4sPVZBhDQwl+J5msFjMB0GA1UdEQQWMBSBEm5vYnVAcnVieS1sYW5nLm9y
25
+ ZzAdBgNVHRIEFjAUgRJub2J1QHJ1YnktbGFuZy5vcmcwDQYJKoZIhvcNAQEFBQAD
26
+ ggEBAAOTOY2YqMGNEBl3EJGymZKYjhSrP7m9g7WreCGRIAPvhc1Ad5nCaU3rhytF
27
+ 9ayF2X6/RGfO0JqLK0ibMS4AXDoSmzngs1YavbpgrFvDr/GDklDn0PeYwvnIjqHF
28
+ 3edYnfvOwpPshdIcSGB++HR1k+MsVQ+thJBg90qvEBXB240paJBebo66AwtnRMtl
29
+ 2s+U8KA5K21h0B3oZO7MPplyoBnkKIi2wM2vXd+bwy2vdDjCm4TmGE3s4tChPqJl
30
+ ZgehHiYUmHxhsoXmVbst3GP52kHNAhVA7+pMpYuYT7glqpuM0sPxtXCucBCBc8Fw
31
+ dUVKuhl19UL3hBtgLSctsrsoXuo=
32
+ -----END CERTIFICATE-----
33
+ date: 2016-03-31 00:00:00.000000000 Z
34
+ dependencies: []
35
+ description: Hash#to_proc which has been added to Ruby 2.3 for older Ruby.
36
+ email:
37
+ - nobu@ruby-lang.org
38
+ executables: []
39
+ extensions: []
40
+ extra_rdoc_files: []
41
+ files:
42
+ - COPYING
43
+ - README.md
44
+ - hash-to_proc.gemspec
45
+ - lib/hash/to_proc.rb
46
+ - test/test_hash_to_proc.rb
47
+ homepage: https://github.com/nobu/hash-to_proc
48
+ licenses:
49
+ - BSD-2-Clause
50
+ metadata: {}
51
+ post_install_message:
52
+ rdoc_options: []
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 2.0.0
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ requirements: []
66
+ rubyforge_project:
67
+ rubygems_version: 2.6.2
68
+ signing_key:
69
+ specification_version: 4
70
+ summary: Hash#to_proc for older Ruby
71
+ test_files:
72
+ - test/test_hash_to_proc.rb
metadata.gz.sig ADDED
Binary file