font-awesome-rails 4.7.0.0 → 4.7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/font_awesome/rails/icon_helper.rb +4 -2
- data/lib/font-awesome-rails/version.rb +1 -1
- data/test/icon_helper_test.rb +16 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac4c977716e754c6950a89aa53e79fdd9e971b2
|
4
|
+
data.tar.gz: 17b236a5d70bfa6aa99d629aed654829d69714c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cce514f1e13b77576647624eb6a387dc827464f7966760664c5ea3ab01a764d2ac837c6a73fabd4b3a421ef165ce0d2455479b3cd1ade2be916bfabea1540baa
|
7
|
+
data.tar.gz: 21df9365e1dad89a36b5ff4a5b665fbd148df2dec86479b48cedfb22a96fd14b6c8150560aaee6ab109a337b7b6bb2dfe381b699b98df0829232c0cbb5d07706
|
@@ -29,7 +29,8 @@ module FontAwesome
|
|
29
29
|
#
|
30
30
|
# content_tag(:li, fa_icon("check li", text: "Bulleted list item"))
|
31
31
|
# # => <li><i class="fa fa-check fa-li"></i> Bulleted list item</li>
|
32
|
-
def fa_icon(names = "flag",
|
32
|
+
def fa_icon(names = "flag", original_options = {})
|
33
|
+
options = original_options.deep_dup
|
33
34
|
classes = ["fa"]
|
34
35
|
classes.concat Private.icon_names(names)
|
35
36
|
classes.concat Array(options.delete(:class))
|
@@ -61,7 +62,8 @@ module FontAwesome
|
|
61
62
|
# # => <i class="fa fa-camera fa-stack-1x"></i>
|
62
63
|
# # => <i class="fa fa-ban-circle fa-stack-2x"></i>
|
63
64
|
# # => </span>
|
64
|
-
def fa_stacked_icon(names = "flag",
|
65
|
+
def fa_stacked_icon(names = "flag", original_options = {})
|
66
|
+
options = original_options.deep_dup
|
65
67
|
classes = Private.icon_names("stack").concat(Array(options.delete(:class)))
|
66
68
|
base_names = Private.array_value(options.delete(:base) || "square-o").push("stack-2x")
|
67
69
|
names = Private.array_value(names).push("stack-1x")
|
data/test/icon_helper_test.rb
CHANGED
@@ -57,6 +57,14 @@ class FontAwesome::Rails::IconHelperTest < ActionView::TestCase
|
|
57
57
|
assert_icon %(<i class="fa fa-user" data-id="123"></i>), "user", :data => { :id => 123 }
|
58
58
|
end
|
59
59
|
|
60
|
+
test '#fa_icon does not modify options' do
|
61
|
+
icon_options = { :class => 'foo', :data => { :id => 123 }, :text => 'bar' }
|
62
|
+
assert_icon %(<i class="fa fa-user foo" data-id="123"></i> bar), "user", icon_options
|
63
|
+
assert_includes icon_options, :class
|
64
|
+
assert_includes icon_options, :text
|
65
|
+
assert_includes icon_options, :data
|
66
|
+
end
|
67
|
+
|
60
68
|
test "#fa_stacked_icon with no args should render a flag icon" do
|
61
69
|
expected = %(<span class="fa-stack">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-flag fa-stack-1x")}</span>)
|
62
70
|
assert_stacked_icon expected
|
@@ -104,6 +112,14 @@ class FontAwesome::Rails::IconHelperTest < ActionView::TestCase
|
|
104
112
|
assert_stacked_icon expected, "user", :base => "square-o", :data => { :id => 123 }
|
105
113
|
end
|
106
114
|
|
115
|
+
test '#fa_stacked_icon does not modify options' do
|
116
|
+
icon_options = { :class => 'foo', :base => "square-o", :data => { :id => 123 } }
|
117
|
+
expected = %(<span class="fa-stack foo" data-id="123">#{i("fa fa-square-o fa-stack-2x")}#{i("fa fa-user fa-stack-1x")}</span>)
|
118
|
+
assert_stacked_icon expected, "user", icon_options
|
119
|
+
assert_includes icon_options, :class
|
120
|
+
assert_includes icon_options, :data
|
121
|
+
end
|
122
|
+
|
107
123
|
private
|
108
124
|
|
109
125
|
def assert_icon(expected, *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: font-awesome-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.7.0.
|
4
|
+
version: 4.7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bokmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.5.1
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: an asset gemification of the font-awesome icon font library
|