fontawesome5-rails 5.0.8.0 → 5.0.8.1
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 +35 -4
- data/lib/fontawesome5/rails/helper.rb +36 -14
- data/lib/fontawesome5/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11543133a22d4f4c61b0a60f01377b788780f0a82a20fc4800c9a4cb76a0e8b3
|
4
|
+
data.tar.gz: 74be0d93baf9ae5c1903d4e286fa908c58077d72e760d310bca09bf1d6dcd780
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dca465110fcdd8cbee079d17af755a64f1ee15ea164fd4fbda4269473783dc372213dca921ccf02e622145060f3fa29092db291fa1937fea54f278196f731ab
|
7
|
+
data.tar.gz: 225772906bcc88baa57186891021ac431e3132a7e6a48c5bfd04f419be13e5ad306ca834d7a7a221e85b39297e57aa7cc7c8f5990dccefc107ab47a2105bb5c6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,8 @@ In this version, Pro icons, light type, are prepared separately.
|
|
5
5
|
|
6
6
|
This gem was built with Font Awesome 5 Free version to use easily as asset pipeline in Rails.
|
7
7
|
|
8
|
+
[](https://badge.fury.io/rb/fontawesome5-rails)
|
9
|
+
|
8
10
|
## Installation
|
9
11
|
|
10
12
|
Add this line to your application's Gemfile:
|
@@ -23,7 +25,7 @@ Or install it yourself as:
|
|
23
25
|
|
24
26
|
## Usage
|
25
27
|
|
26
|
-
In Font Awesome 5 Free version, there are 3
|
28
|
+
In Font Awesome 5 Free version, there are 3 icon styles:
|
27
29
|
|
28
30
|
- Regular : `<i class="far fa-address-book"></i>`
|
29
31
|
- Solid : `<i class="fas fa-address-book"></i>`
|
@@ -43,24 +45,53 @@ The only one step to use Font Awesome 5 in Rails is needed. In app/assets/applic
|
|
43
45
|
|
44
46
|
And, out of box, you can use some useful helper methods as follows:
|
45
47
|
|
46
|
-
-
|
48
|
+
- fa_icon(shape, options = {}) or far_icon(shape, options = {})
|
47
49
|
```erb
|
50
|
+
<%= fa_icon 'address-book' %>
|
51
|
+
<%= fa_icon 'address-book', text: 'Address Book' %>
|
52
|
+
<%= fa_icon 'address-book', text: 'Address Bookconfirm', size: '2x' %>
|
48
53
|
<%= far_icon 'address-book' %>
|
49
54
|
<%= far_icon 'address-book', text: 'Address Book' %>
|
50
55
|
<%= far_icon 'address-book', text: 'Address Bookconfirm', size: '2x' %>
|
51
56
|
```
|
52
|
-
- fas_icon(shape, options = {
|
57
|
+
- fas_icon(shape, options = {})
|
53
58
|
```erb
|
54
59
|
<%= fas_icon 'address-book' %>
|
55
60
|
<%= fas_icon 'address-book', text: 'Address Book' %>
|
56
61
|
<%= fas_icon 'address-book', text: 'Address Book', size: '2x' %>
|
57
62
|
```
|
58
|
-
- fab_icon(shape, options = {
|
63
|
+
- fab_icon(shape, options = {})
|
59
64
|
```erb
|
60
65
|
<%= fab_icon 'apple' %>
|
61
66
|
<%= fab_icon 'apple', text: 'Apple' %>
|
62
67
|
<%= fab_icon 'apple', text: 'Apple', size: '2x' %>
|
63
68
|
```
|
69
|
+
- fa_icon_text(shape, text = '', options = {}) or far_icon_text(shape, text = '', options = {})
|
70
|
+
```erb
|
71
|
+
<%= fa_icon_text 'address-book', 'Address Book' %>
|
72
|
+
<%= fa_icon_text 'address-book', 'Address Bookconfirm', size: '2x' %>
|
73
|
+
<%= far_icon_text 'address-book', 'Address Book' %>
|
74
|
+
<%= far_icon_text 'address-book', 'Address Bookconfirm', size: '2x' %>
|
75
|
+
```
|
76
|
+
- fas_icon_text(shape, text = '', options = {})
|
77
|
+
```erb
|
78
|
+
<%= fas_icon 'address-book', 'Address Book' %>
|
79
|
+
<%= fas_icon 'address-book', 'Address Book', size: '2x' %>
|
80
|
+
```
|
81
|
+
- fab_icon_text(shape, text = '', options = {})
|
82
|
+
```erb
|
83
|
+
<%= fab_icon 'apple', 'Apple' %>
|
84
|
+
<%= fab_icon 'apple', 'Apple', size: '2x' %>
|
85
|
+
```
|
86
|
+
|
87
|
+
## Changelog
|
88
|
+
|
89
|
+
- v5.0.8.1
|
90
|
+
- added generic fa_icon() helper with 'regular' icon style by defult.
|
91
|
+
- added generic fa_icon_text() helper with `text` argument which is extracted from `opt` hash argument.
|
92
|
+
|
93
|
+
- v5.0.8.0
|
94
|
+
- released the first version on March 10, 2018.
|
64
95
|
|
65
96
|
## Development
|
66
97
|
|
@@ -1,26 +1,48 @@
|
|
1
1
|
module Fontawesome5
|
2
2
|
module Rails
|
3
3
|
module Helper
|
4
|
-
def
|
4
|
+
def fa_icon(icon_name, opt = {})
|
5
|
+
opt.reverse_merge!(style_prefix: 'far', text: '', icon_size: '1x', class: 'mr-0')
|
5
6
|
capture do
|
6
|
-
concat(content_tag(:i, '', class: "
|
7
|
-
concat(
|
7
|
+
concat(content_tag(:i, '', class: "#{opt[:style_prefix]} fa-#{icon_name} fa-#{opt[:icon_size]} #{opt[:class]}"))
|
8
|
+
concat(opt[:text])
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
concat(options[:text])
|
15
|
-
end
|
12
|
+
def far_icon(icon_name, opt = {})
|
13
|
+
opt.reverse_merge!(style_prefix: 'far', text: '', icon_size: '1x', class: 'mr-0')
|
14
|
+
fa_icon(icon_name, opt)
|
16
15
|
end
|
17
16
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
def fas_icon(icon_name, opt = {})
|
18
|
+
opt.reverse_merge!(style_prefix: 'fas', text: '', icon_size: '1x', class: 'mr-0')
|
19
|
+
fa_icon(icon_name, opt)
|
20
|
+
end
|
21
|
+
|
22
|
+
def fab_icon(icon_name, opt = {})
|
23
|
+
opt.reverse_merge!(style_prefix: 'fab', text: '', icon_size: '1x', class: 'mr-0')
|
24
|
+
fa_icon(icon_name, opt)
|
25
|
+
end
|
26
|
+
|
27
|
+
def fa_icon_text(icon_name, text = '', opt = {})
|
28
|
+
opt.reverse_merge!(style_prefix: 'far', text: text, icon_size: '1x', class: 'mr-1')
|
29
|
+
fa_icon(icon_name, opt)
|
30
|
+
end
|
31
|
+
|
32
|
+
def far_icon_text(icon_name, text = '', opt = {})
|
33
|
+
opt.reverse_merge!(style_prefix: 'far', text: text, icon_size: '1x', class: 'mr-1')
|
34
|
+
fa_icon(icon_name, opt)
|
35
|
+
end
|
36
|
+
|
37
|
+
def fas_icon_text(icon_name, text = '', opt = {})
|
38
|
+
opt.reverse_merge!(style_prefix: 'fas', text: text, icon_size: '1x', class: 'mr-1')
|
39
|
+
fa_icon(icon_name, opt)
|
40
|
+
end
|
41
|
+
|
42
|
+
def fab_icon_text(icon_name, text = '', opt = {})
|
43
|
+
opt.reverse_merge!(style_prefix: 'fab', text: text, icon_size: '1x', class: 'mr-1')
|
44
|
+
fa_icon(icon_name, opt)
|
23
45
|
end
|
24
46
|
end
|
25
47
|
end
|
26
|
-
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fontawesome5-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.8.
|
4
|
+
version: 5.0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucius Choi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|