font_awesome5_rails 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +60 -0
- data/app/assets/images/fa-brands.svg +1 -1
- data/app/assets/images/fa-regular.svg +1 -1
- data/app/assets/images/fa-solid.svg +1 -1
- data/app/assets/javascripts/fontawesome-all.min.js +2 -2
- data/app/assets/stylesheets/fa-svg-with-js.css +1 -1
- data/app/assets/stylesheets/font_awesome5.css +5 -1
- data/app/helpers/font_awesome5/rails/icon_helper.rb +44 -0
- data/lib/font_awesome5_rails/{fa_icon_parser.rb → parsers/fa_icon_parser.rb} +7 -21
- data/lib/font_awesome5_rails/parsers/fa_layered_icon_parser.rb +28 -0
- data/lib/font_awesome5_rails/parsers/fa_stacked_icon_parser.rb +43 -0
- data/lib/font_awesome5_rails/parsers/parse_methods.rb +24 -0
- data/lib/font_awesome5_rails/version.rb +2 -2
- data/spec/font_awesome5_rails_spec.rb +53 -5
- data/spec/spec_helper.rb +1 -1
- metadata +7 -4
- data/app/helpers/font_awesome/rails/icon_helper.rb +0 -23
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'font_awesome5_rails/fa_icon_parser'
|
2
|
-
|
3
|
-
module FontAwesome
|
4
|
-
module Rails
|
5
|
-
module IconHelper
|
6
|
-
|
7
|
-
def fa_icon(icon, options = {})
|
8
|
-
parser = FaIconParser.new(icon, options)
|
9
|
-
tags = []
|
10
|
-
if parser.text.nil?
|
11
|
-
tags << content_tag(:i, nil, class: parser.classes, style: parser.style, data: parser.data)
|
12
|
-
else
|
13
|
-
content_tag :span do
|
14
|
-
tags << content_tag(:i, nil, class: parser.classes, style: parser.style, data: parser.data)
|
15
|
-
tags << content_tag(:span, parser.text, style: "padding-left: 5px;#{parser.style}")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
tags.join.html_safe
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|