enum_to_h 0.1.1 → 0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/enum_to_h.rb +17 -2
  3. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 528018170461b9e292028ad00f0e4a78d7fd4b4c
4
- data.tar.gz: 6564aadb580e0c60f8f03795bd8e5d2be2c07b19
3
+ metadata.gz: f7d012f1b6050724969566715c174ebcfe102128
4
+ data.tar.gz: bfc43cec402e122d8c04ec1cd8e91aa89eb9923d
5
5
  SHA512:
6
- metadata.gz: d6b1cfb3d6afb3e0d89f52819eed0b55c2329213cc29fffd2db67064cb119923f9d0bb42920efa164cc563b02901f94fbff7b8e1bb086c66433d133d840475ed
7
- data.tar.gz: 788a71c9c3d4f42d0d70c0f9c4bfafc3f222fab6800fcd08f124010b437a21e54dbd81f51d446f4f9626c78d6efd95280d32939626ea999a419e118c2948e597
6
+ metadata.gz: bb8c847afdec01ff7d30b8643d9e21eea4d91e6ded704bd41653633c7639bb5338bbd27cbe105f8e5b58037a46b57679328bf8ca9ea45c84d0e3ce30e84d5fd3
7
+ data.tar.gz: d7b8e0bc81a5a6248b482d9cf6a6571af7b5f197addf042001780333a8d9a107cd052f0757bded9b2c08d1d6be5a87bfa8d9ed43988e87c3df6f8f8d5c15c79e
@@ -1,4 +1,3 @@
1
-
2
1
  module Enumerable
3
2
  #
4
3
  # Converts +enum+ to a Hash.
@@ -15,10 +14,26 @@ module Enumerable
15
14
  def to_h
16
15
  hsh = {}
17
16
  each do |k,v,*x|
18
- raise ArgumentError, "invalid number of elements (#{x.length+1} for 1..2)" if x.any?
17
+ raise ArgumentError, "invalid number of elements (#{x.length+2} for 1..2)" if x.any?
19
18
  hsh[k] = v
20
19
  end
21
20
  hsh
22
21
  end
23
22
  end
24
23
 
24
+ =begin
25
+ Copyright (c) 2013,2014, Matthew Kerwin <matthew@kerwin.net.au>
26
+
27
+ Permission to use, copy, modify, and/or distribute this software for any
28
+ purpose with or without fee is hereby granted, provided that the above
29
+ copyright notice and this permission notice appear in all copies.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
32
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
33
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
34
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
35
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
36
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
37
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
38
+ =end
39
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_to_h
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Kerwin
@@ -20,7 +20,7 @@ files:
20
20
  - lib/enum_to_h.rb
21
21
  homepage: http://rubygems.org/gems/enum_to_h
22
22
  licenses:
23
- - Simplified BSD License
23
+ - ISC License
24
24
  metadata: {}
25
25
  post_install_message:
26
26
  rdoc_options: []
@@ -37,9 +37,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  requirements:
40
+ - Ruby <2.1
40
41
  - to_h, for Ruby <2.0
41
42
  rubyforge_project:
42
- rubygems_version: 2.0.0
43
+ rubygems_version: 2.0.3
43
44
  signing_key:
44
45
  specification_version: 4
45
46
  summary: Enumerable#to_h