heroicons_helper 0.2.2 → 0.3.0

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: 1567311352d143cb38d0ebf41388ab02cffa75dde06c9aa02694d06dfde7e3ef
4
- data.tar.gz: b865c9123848efdf54afda2336491a15f7289a9e2f91a2a005731436e248c01a
3
+ metadata.gz: ea79c1638e02674896f2f251375b879df8e289d10c39bd1b6550b35f65bb667e
4
+ data.tar.gz: 49e4f89e38f7ceec4e09970d9864f859424f4e59f314b40353df87e73ff128b9
5
5
  SHA512:
6
- metadata.gz: 9461351e92db53399116d07f77cbcde4094f50201f550b02d8dcaa125e9671a90b84300c831610be743c6be72d7f578c1069f9ec6e505af484481797225f9c91
7
- data.tar.gz: 67d4d42f881e0d435494eaa79890b55022d6187d2f99b26dea652d5a0517203ffcc4f531da01a64ed04b8a15f405f9e080539b25999ca823804b49148c7164aa
6
+ metadata.gz: c4c7715c0dc796769dd80fd26e38a56bbccadb1c00418ac0ff8911722679bd571e2a2cb058ecbf3931e9c6da3020628239ee5500ef90b05aed66c53f856bec5c
7
+ data.tar.gz: 0257f55a823a70b7147b4ac0d7c3051fd407febea7577b0ffd2cc9bb2e14b7582299daae2a425f273de59ca7bd4dd5ddd51181baeb5ac40cdd47c1006224a324
data/README.md CHANGED
@@ -22,10 +22,10 @@ require "heroicons_helper"
22
22
  include HeroiconsHelper
23
23
  ```
24
24
 
25
- You'll have a brand new method called `heroicons` whose signature looks like this:
25
+ You'll have a brand new method called `heroicon` whose signature looks like this:
26
26
 
27
27
  ```ruby
28
- heroicons(symbol, variant, attributes: {})
28
+ heroicon(symbol, variant, attributes: {})
29
29
  ```
30
30
 
31
31
  where
@@ -37,7 +37,7 @@ where
37
37
  This one method call returns an object that represents the Heroicon, and you should call `to_svg` to get the resulting SVG string:
38
38
 
39
39
  ```ruby
40
- outline_icon = heroicons("x", "outline")
40
+ outline_icon = heroicon("x", "outline")
41
41
  puts outline_icon.to_svg
42
42
  ```
43
43
  ```
@@ -58,7 +58,7 @@ icons_to_preload = [{
58
58
  },]
59
59
 
60
60
  HeroiconsHelper::Cache.preload!(icons_to_preload) do |found, icon|
61
- # An instance of `FakeClass` is stored in the cache
61
+ # An instance of `FakeClass` will be stored in the cache
62
62
  FakeClass.new(icon) unless found
63
63
  end
64
64
  ```
@@ -57,6 +57,7 @@ module HeroiconsHelper
57
57
  def get_heroicon(symbol, variant)
58
58
  symbol_s = symbol.to_s
59
59
  raise ArgumentError, "Icon name can't be empty" if symbol_s.empty?
60
+
60
61
  variant_s = variant.to_s
61
62
  raise ArgumentError, "Variant `#{variant.inspect}` is invalid; must be one of #{VARIANTS.join(", ")}" unless VARIANTS.include?(variant_s)
62
63
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HeroiconsHelper
4
- VERSION = "0.2.2"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -9,7 +9,7 @@ module HeroiconsHelper
9
9
  file_data = File.read(File.join(File.dirname(__FILE__), "./heroicons_helper/data.json"))
10
10
  ICON_SYMBOLS = JSON.parse(file_data).freeze
11
11
 
12
- def heroicons(symbol, variant, attributes: {})
12
+ def heroicon(symbol, variant, attributes: {})
13
13
  ::HeroiconsHelper::Icon.new(symbol, variant, attributes: attributes)
14
14
  end
15
15
  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.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian