is-enum 0.8.8 → 0.8.8.4
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 +4 -4
- data/coverage-badge.svg +6 -0
- data/lib/is-enum/info.rb +1 -1
- data/lib/is-enum.rb +3 -3
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45da221cf6e20d8ac5f2066bb1ecee75ce27e322f42b26e22fcb0b1c8c1e8911
|
|
4
|
+
data.tar.gz: a48007b7ebf85be71d45de95c656349f8bb3f95bc73639f5986bb9db582355ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ccffdc70f7223a1b074d5d0c5819e72888754f25799327f69463c53d106d93225d366a0fb3be0b136793f11851213875db21b4f3a4e8b7bd6891cf7bf954898
|
|
7
|
+
data.tar.gz: 586cb74f64befb4f126088038245a292cdec73b67149b538eaa6c6877f167b4a576ab35ef2e90a1643127d94f04f3bed9de3d60ac9ed14868a5ef9f87efea1a0
|
data/coverage-badge.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0"?><svg xmlns="http://www.w3.org/2000/svg" width="100" height="20">
|
|
2
|
+
<rect width="100" height="20" fill="#555"/>
|
|
3
|
+
<rect x="63" width="37" height="20" fill="green"/>
|
|
4
|
+
<text x="8" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
|
|
5
|
+
<text x="66" y="14" fill="#fff" font-family="Verdana" font-size="11">91%</text>
|
|
6
|
+
</svg>
|
data/lib/is-enum/info.rb
CHANGED
data/lib/is-enum.rb
CHANGED
|
@@ -11,8 +11,8 @@ module IS; end
|
|
|
11
11
|
#
|
|
12
12
|
# @note Class variables
|
|
13
13
|
#
|
|
14
|
-
# Uses class variables (
|
|
15
|
-
# hierarchy. All enum classes register in global
|
|
14
|
+
# Uses class variables ( +@@enums+, +@@mutex+ ) shared across inheritance
|
|
15
|
+
# hierarchy. All enum classes register in global +@@enums+ for {.parse}.
|
|
16
16
|
#
|
|
17
17
|
# @note Custom attributes
|
|
18
18
|
#
|
|
@@ -99,7 +99,7 @@ class IS::Enum
|
|
|
99
99
|
when Enumerable
|
|
100
100
|
value.map { |v| from(v) }
|
|
101
101
|
else
|
|
102
|
-
self[value]
|
|
102
|
+
self[value] || raise ArgumentError, "Invalid value of #{ self }: #{ value.inspect }", caller_locations
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: is-enum
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.8
|
|
4
|
+
version: 0.8.8.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Shikhalev
|
|
@@ -99,6 +99,7 @@ extra_rdoc_files: []
|
|
|
99
99
|
files:
|
|
100
100
|
- LICENSE
|
|
101
101
|
- README.md
|
|
102
|
+
- coverage-badge.svg
|
|
102
103
|
- lib/is-enum.rb
|
|
103
104
|
- lib/is-enum/info.rb
|
|
104
105
|
homepage: https://github.com/inat-get/is-enum
|