fa_rails 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +13 -7
- data/fa_rails.gemspec +1 -1
- data/lib/fa/layer.rb +1 -0
- data/spec/lib/fa_spec.rb +18 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3968254b8c159868cfb8ea652f34eff2326c36f
|
4
|
+
data.tar.gz: 11acb7f382f5aad18ad03b34bb927fc3eaeb1cfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 122bb5a2e2f171f2208a04015defbce07e7865aef2a4c286c0a79e6ed1b4a163097289bb75b3bda665110ef8f40fea0e7ef96d06650e5643eed6c497fd03fc9f
|
7
|
+
data.tar.gz: f83c382aaff389202657466094af61f4e479539797a47e96dcc9e29b9dfb4dc66a4667989d0b6e0c0468b5618c086a37585e39c6c1204b8cfc88338f3874b752
|
data/Gemfile.lock
CHANGED
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
data/lib/fa/layer.rb
CHANGED
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
|
-
'</
|
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
|
-
|
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
|