fa_rails 0.1.18 → 0.1.19

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: 771f0170fa690c018158f89119397efc56702af5e02b94bb2627b0f6f2b4cab6
4
- data.tar.gz: 2b5bef6128cd65714edaea480c8024c3f871a3d4c240d79eb008411afbfc0f2c
3
+ metadata.gz: a81bde1565370f75213aca86e1c432726e01abd3728b6b5b03c6945071ef4129
4
+ data.tar.gz: 2438f2c1a9a9e904baebf0dcea5cb9717671bea5b435a1e2a48981dd50c9cadd
5
5
  SHA512:
6
- metadata.gz: 06bb529758d62780a54fcc01db8a94ae5bf71e12a4f5b936ff7a7c5198eb96d5ed0e31cc41f9690dba08a3010542ffbdeb7ac0661f2668b82404705b5eac8bbf
7
- data.tar.gz: 605a8dfe7d36472432e87f99f55faab94e8e6012af8f0e52e448230126ad4ea537fc13fd6494b020c1e9b71bc19ea5d9193ab22444fb454b7db49347338107f2
6
+ metadata.gz: 9827cf41bc93a5f7a5cbbb053c4c3a98c506dc0484a6688dcdab49396220ebf24c98ec4c5e90b93d60a1545811a8f7d36c04b2f91f43dddd17d93f3fb0dbe989
7
+ data.tar.gz: 397edebc13362c58052348c122fe95543059bbea1f7de183a4388182f6ce0ba003064522db82100a89218b933781e55a159418d64bb0f1c51480d7e60e2acb41
data/fa_rails.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'fa_rails'
3
- s.version = '0.1.18'
3
+ s.version = '0.1.19'
4
4
  s.date = '2019-07-29'
5
5
  s.summary = 'FontAwesome helper for Rails'
6
6
  s.description = 'A helper module for using FontAwesome icons in Rails.'
data/lib/fa/base.rb CHANGED
@@ -9,8 +9,8 @@ module FA
9
9
  end
10
10
 
11
11
  # Attempts to call `.html_safe` on the the output of `raw`, if available.
12
- def safe
13
- output = raw
12
+ def safe(html = nil)
13
+ output = html || raw
14
14
  output.respond_to?(:html_safe) ? output.html_safe : output
15
15
  end
16
16
 
data/lib/fa/link.rb CHANGED
@@ -26,6 +26,11 @@ module FA
26
26
  "<script src=\"https://kit.fontawesome.com/#{@kit}.js\"></script>"
27
27
  end
28
28
 
29
+ def self.kit(kit_id)
30
+ k = new(kit: kit_id)
31
+ k.safe(k.kit)
32
+ end
33
+
29
34
  private
30
35
 
31
36
  def url
data/spec/lib/fa_spec.rb CHANGED
@@ -14,8 +14,8 @@ RSpec.describe FA do
14
14
  end
15
15
 
16
16
  it 'should generate the correct kit link tag' do
17
- tag = FA::Link.new(kit: 'abcdefg', pro: true)
18
- expect(tag.kit).to eql(
17
+ tag = FA::Link.kit('abcdefg')
18
+ expect(tag).to eql(
19
19
  "<script src=\"https://kit.fontawesome.com/abcdefg.js\"></script>"
20
20
  )
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fa_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander