heroicons_helper 0.2.1 → 0.2.2

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: 82d8da995254ac85d7fe26d34eb87e3275a5469e296a5684ca2a961ea6cd36d6
4
- data.tar.gz: eaea3e8f1913c02803c9a8f1d3059ccc41a18810791687cb9b15249b0ab25e83
3
+ metadata.gz: 1567311352d143cb38d0ebf41388ab02cffa75dde06c9aa02694d06dfde7e3ef
4
+ data.tar.gz: b865c9123848efdf54afda2336491a15f7289a9e2f91a2a005731436e248c01a
5
5
  SHA512:
6
- metadata.gz: f237870c06e656d6056c3f3efc48d79ecbeffc99a9688d575d289794269ca476147319af658fb38e9e08cb8b07f00708a8bd9d616309882a18628f9e881f613f
7
- data.tar.gz: 320e20817dd459fa7b5f18d2b4d218b0a715abc3a7c4b88e3e805a2d4a207c11b1fe9fac81db1b90711f165c1278e167818def8097f0ad9c34c05624e8114cc0
6
+ metadata.gz: 9461351e92db53399116d07f77cbcde4094f50201f550b02d8dcaa125e9671a90b84300c831610be743c6be72d7f578c1069f9ec6e505af484481797225f9c91
7
+ data.tar.gz: 67d4d42f881e0d435494eaa79890b55022d6187d2f99b26dea652d5a0517203ffcc4f531da01a64ed04b8a15f405f9e080539b25999ca823804b49148c7164aa
@@ -55,19 +55,21 @@ 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)
58
+ symbol_s = symbol.to_s
59
+ raise ArgumentError, "Icon name can't be empty" if symbol_s.empty?
60
+ variant_s = variant.to_s
61
+ raise ArgumentError, "Variant `#{variant.inspect}` is invalid; must be one of #{VARIANTS.join(", ")}" unless VARIANTS.include?(variant_s)
60
62
 
61
- icon = HeroiconsHelper::ICON_SYMBOLS[symbol]
63
+ icon = HeroiconsHelper::ICON_SYMBOLS[symbol_s]
62
64
 
63
65
  raise ArgumentError, "Couldn't find Heroicon for `#{symbol.inspect}`" unless icon
64
66
 
65
- icon_in_variant = icon["variants"][variant]
67
+ icon_in_variant = icon["variants"][variant_s]
66
68
  raise ArgumentError, "Heroicon for `#{symbol.inspect}` doesn't have variant `#{variant.inspect}`" unless icon_in_variant
67
69
 
68
70
  {
69
71
  "name" => icon["name"],
70
- "variant" => variant,
72
+ "variant" => variant_s,
71
73
  "width" => icon_in_variant["width"],
72
74
  "height" => icon_in_variant["height"],
73
75
  "path" => icon_in_variant["path"],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HeroiconsHelper
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian