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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9485a0987958ed95a778847a047f7f139167bb68105b7bdf7ec82fdc77db73a7
4
- data.tar.gz: e1ca7235a593ad2f5733283192c08b0d45bb4839720fa9e5e2527588e470e35e
3
+ metadata.gz: 11543133a22d4f4c61b0a60f01377b788780f0a82a20fc4800c9a4cb76a0e8b3
4
+ data.tar.gz: 74be0d93baf9ae5c1903d4e286fa908c58077d72e760d310bca09bf1d6dcd780
5
5
  SHA512:
6
- metadata.gz: 33fcd9a0f253d2819fa8001915ad2baee77aa491c4c890ac6298aa7c448996bf2c8096007fc677c910ee7ed606d43468fa7c43bf53275ce0a64480724152fd75
7
- data.tar.gz: 669f2756ac31253885c6fe7d1ffa12432ed29750fedb4bb2ae6c855a0b62f93a1329ea93499f27a7676338c75c77d5ba4185da3e0feb6092dcc678c8ca3cc2a1
6
+ metadata.gz: 3dca465110fcdd8cbee079d17af755a64f1ee15ea164fd4fbda4269473783dc372213dca921ccf02e622145060f3fa29092db291fa1937fea54f278196f731ab
7
+ data.tar.gz: 225772906bcc88baa57186891021ac431e3132a7e6a48c5bfd04f419be13e5ad306ca834d7a7a221e85b39297e57aa7cc7c8f5990dccefc107ab47a2105bb5c6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fontawesome5-rails (5.0.8.0)
4
+ fontawesome5-rails (5.0.8.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
+ [![Gem Version](https://badge.fury.io/rb/fontawesome5-rails.svg)](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 types of font:
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
- - far_icon(shape, options = { text: '', size: '1x' })
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 = { text: '', size: '1x' })
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 = { text: '', size: '1x' })
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 far_icon(shape, options = { text: '', size: '1x' })
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: "far fa-#{shape} fa-#{options[:size]} mr-1"))
7
- concat(options[:text])
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 fas_icon(shape, options = { text: '', size: '1x' })
12
- capture do
13
- concat(content_tag(:i, '', class: "fas fa-#{shape} fa-#{options[:size]} mr-1"))
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 fab_icon(shape, options = { text: '', size: '1x' })
19
- capture do
20
- concat(content_tag(:i, '', class: "fab fa-#{shape} fa-#{options[:size]} mr-1"))
21
- concat(options[:text])
22
- end
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
@@ -1,5 +1,5 @@
1
1
  module Fontawesome5
2
2
  module Rails
3
- VERSION = "5.0.8.0"
3
+ VERSION = "5.0.8.1"
4
4
  end
5
5
  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.0
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-10 00:00:00.000000000 Z
11
+ date: 2018-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler