heroicons_helper 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/heroicons_helper/icon.rb +6 -2
- data/lib/heroicons_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82d8da995254ac85d7fe26d34eb87e3275a5469e296a5684ca2a961ea6cd36d6
|
4
|
+
data.tar.gz: eaea3e8f1913c02803c9a8f1d3059ccc41a18810791687cb9b15249b0ab25e83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f237870c06e656d6056c3f3efc48d79ecbeffc99a9688d575d289794269ca476147319af658fb38e9e08cb8b07f00708a8bd9d616309882a18628f9e881f613f
|
7
|
+
data.tar.gz: 320e20817dd459fa7b5f18d2b4d218b0a715abc3a7c4b88e3e805a2d4a207c11b1fe9fac81db1b90711f165c1278e167818def8097f0ad9c34c05624e8114cc0
|
@@ -55,11 +55,15 @@ module HeroiconsHelper
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def get_heroicon(symbol, variant)
|
58
|
+
raise ArgumentError, "Icon name can't be empty" unless !symbol.to_s.empty?
|
59
|
+
raise ArgumentError, "Variant `#{variant}` is invalid; must be one of #{VARIANTS.join(", ")}" unless VARIANTS.include?(variant.to_s)
|
60
|
+
|
58
61
|
icon = HeroiconsHelper::ICON_SYMBOLS[symbol]
|
59
|
-
|
62
|
+
|
63
|
+
raise ArgumentError, "Couldn't find Heroicon for `#{symbol.inspect}`" unless icon
|
60
64
|
|
61
65
|
icon_in_variant = icon["variants"][variant]
|
62
|
-
raise "
|
66
|
+
raise ArgumentError, "Heroicon for `#{symbol.inspect}` doesn't have variant `#{variant.inspect}`" unless icon_in_variant
|
63
67
|
|
64
68
|
{
|
65
69
|
"name" => icon["name"],
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroicons_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.3.
|
61
|
+
rubygems_version: 3.3.7
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: Heroicons port for Ruby
|