fa_rails 0.1.12 → 0.1.13

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
  SHA1:
3
- metadata.gz: c33ec94dc626c180aaa7587f6919e9359255b44a
4
- data.tar.gz: 9f4c3f64315ad8558e14e00a3d51280e6b346374
3
+ metadata.gz: c3968254b8c159868cfb8ea652f34eff2326c36f
4
+ data.tar.gz: 11acb7f382f5aad18ad03b34bb927fc3eaeb1cfa
5
5
  SHA512:
6
- metadata.gz: d31c7603c4a274120b6e0e29713d909996f4836a10fdd020f723a3bd13532e86b46d9a2589ea7d0407d7502579b2cccd131993c5eab56b4b84d5e756538f8f02
7
- data.tar.gz: 8361ed55763154d0cac06d3f724cd210fd8444d81fa79a995f08cceaa6ef4056da098aaa14076127845026bfa6b301c225704ccc635458abd81190eb05b6b2f2
6
+ metadata.gz: 122bb5a2e2f171f2208a04015defbce07e7865aef2a4c286c0a79e6ed1b4a163097289bb75b3bda665110ef8f40fea0e7ef96d06650e5643eed6c497fd03fc9f
7
+ data.tar.gz: f83c382aaff389202657466094af61f4e479539797a47e96dcc9e29b9dfb4dc66a4667989d0b6e0c0468b5618c086a37585e39c6c1204b8cfc88338f3874b752
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fa_rails (0.1.12)
4
+ fa_rails (0.1.13)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -10,23 +10,29 @@ You must still have your own FontAwesome Pro license, or install the
10
10
  [Free](https://use.fontawesome.com/releases/v5.2.0/fontawesome-free-5.2.0-web.zip)
11
11
  package.
12
12
 
13
- ### Local Files
14
-
15
- Copy the complete `js` and `css` directories from the
16
- [web download](https://fontawesome.com/releases/5.2.0/web/download) into the
17
- corresponding locations in your app, and ensure you correctly include all files.
18
-
19
13
  Add the following to `config/application.rb`:
20
14
 
21
15
  ```ruby
22
16
  require 'fa'
23
17
  ```
24
18
 
19
+ ### Local Files
20
+
21
+ Copy the complete `js` and `css` directories from the
22
+ [web download](https://fontawesome.com/releases/5.2.0/web/download) into the
23
+ corresponding locations in your app, and ensure you correctly include all files.
24
+
25
25
  ### FontAwesome CDN
26
26
 
27
27
  Go to the FontAwesome
28
28
  [How to Use](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css)
29
- page and copy the appropriate CDN link tag:
29
+ page and copy the appropriate CDN link tag.
30
+
31
+ You can also `include FA`, then use the built-in helper method in your layout:
32
+
33
+ ```ruby
34
+ FA::Link.new(version: 'v5.2.0', integrity: 'sha384-some-key-here').safe
35
+ ```
30
36
 
31
37
  #### Free
32
38
 
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.12'
3
+ s.version = '0.1.13'
4
4
  s.date = '2018-07-30'
5
5
  s.summary = 'FontAwesome helper for Rails'
6
6
  s.description = 'A helper module for using FontAwesome icons in Rails.'
data/lib/fa/layer.rb CHANGED
@@ -29,6 +29,7 @@ module FA
29
29
 
30
30
  @icons.each do |i|
31
31
  i[:options] = combine_options(i, combine_grows(i, @grow))
32
+ i[:options][:title] = @title
32
33
  end
33
34
 
34
35
  span_top + parse_all(@icons).join + span_bottom
data/spec/lib/fa_spec.rb CHANGED
@@ -57,8 +57,8 @@ RSpec.describe FA do
57
57
  "<span class='icon fa-layers fa-stack fa-fw ' title=''>" \
58
58
  "<i class='fas fa-stack-1x fa-square fa-1x' data-fa-transform='grow-2' title=''></i>" \
59
59
  "<i class='fas fa-stack-1x fa-circle fa-1x' data-fa-transform='grow-3' title=''></i>" \
60
- "<i class='far fa-stack-1x fa-exclamation fa-1x' data-fa-transform='grow-2' title=''>" \
61
- '</i></span>'
60
+ "<i class='far fa-stack-1x fa-exclamation fa-1x' data-fa-transform='grow-2' title=''></i>" \
61
+ '</span>'
62
62
  )
63
63
  end
64
64
 
@@ -71,8 +71,22 @@ RSpec.describe FA do
71
71
  expect(FA::Layer.new(icons).safe).to eql(
72
72
  "<span class='icon fa-layers fa-stack fa-fw ' title=''>" \
73
73
  "<i class='fas fa-stack-1x fa-square fa-1x' data-fa-transform='grow-0' title=''></i>" \
74
- "<span class='fa-stack-1x fa-layers-counter fa-layers-top-left' " \
75
- "data-fa-transform='grow-0'>17</span></span>"
74
+ "<span class='fa-stack-1x fa-layers-counter fa-layers-top-left' data-fa-transform='grow-0'>17</span>" \
75
+ '</span>'
76
+ )
77
+ end
78
+
79
+ it 'should apply layer titles to all icons' do
80
+ icons = [
81
+ { name: :square, title: 'wrong 1' },
82
+ { name: :exclamation, title: 'wrong 2' }
83
+ ]
84
+
85
+ expect(FA::Layer.new(icons, title: 'right').safe).to eql(
86
+ "<span class='icon fa-layers fa-stack fa-fw ' title='right'>" \
87
+ "<i class='fas fa-stack-1x fa-square fa-1x' data-fa-transform='grow-0' title='right'></i>" \
88
+ "<i class='fas fa-stack-1x fa-exclamation fa-1x' data-fa-transform='grow-0' title='right'></i>" \
89
+ '</span>'
76
90
  )
77
91
  end
78
92
  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.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander