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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95ec724478d383801f98ffeeb2bd8d0f5f14fea4c6eee777b59b9bc5e0337d78
4
- data.tar.gz: 18e9be3121ca73f11a472a36ed35d31b2c157a12a4d177395e82ea7d5dacf993
3
+ metadata.gz: 82d8da995254ac85d7fe26d34eb87e3275a5469e296a5684ca2a961ea6cd36d6
4
+ data.tar.gz: eaea3e8f1913c02803c9a8f1d3059ccc41a18810791687cb9b15249b0ab25e83
5
5
  SHA512:
6
- metadata.gz: 5ab5881814e673ef1d7ee9e24f454a05796c4558baaa780a3c0d7a1365dec92e67858c535b41e046b3cf548b9265a9446fbdb38fc10631e3e1475566f074a742
7
- data.tar.gz: 4fee60bcdd51cb3109fc48acde1693a702f965ab3475f9f9ebce6ed9e26110f5cc668febde294e4d20f30cbe6de64d07aae1e686ec7f62d742987a3ca98aa111
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
- raise "Couldn't find heroicons symbol for #{@symbol.inspect}" unless icon
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 "Heroicons symbol for #{@symbol.inspect} doesn't have variant #{@variant.inspect}" unless icon_in_variant
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"],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HeroiconsHelper
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
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.0
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.13
61
+ rubygems_version: 3.3.7
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Heroicons port for Ruby