deas-erbtags 0.4.0 → 0.4.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.
- data/lib/deas-erbtags/utils.rb +2 -2
- data/lib/deas-erbtags/version.rb +1 -1
- data/test/unit/utils_tests.rb +2 -2
- metadata +3 -3
data/lib/deas-erbtags/utils.rb
CHANGED
@@ -31,8 +31,8 @@ module Deas::ErbTags
|
|
31
31
|
end.join
|
32
32
|
end
|
33
33
|
|
34
|
-
def self.insert_html_class(
|
35
|
-
(Set.new(
|
34
|
+
def self.insert_html_class(current, *to_insert)
|
35
|
+
(Set.new((current || '').split(' ')) + Set.new(to_insert)).sort.join(' ')
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
data/lib/deas-erbtags/version.rb
CHANGED
data/test/unit/utils_tests.rb
CHANGED
@@ -14,10 +14,10 @@ module Deas::ErbTags::Utils
|
|
14
14
|
end
|
15
15
|
|
16
16
|
should "insert html class values into a given html class string" do
|
17
|
-
none =
|
17
|
+
none = nil
|
18
18
|
assert_equal '', subject.insert_html_class(none)
|
19
19
|
assert_equal 'a', subject.insert_html_class(none, 'a')
|
20
|
-
assert_equal 'a b', subject.insert_html_class(none, 'b', 'a')
|
20
|
+
assert_equal 'a b', subject.insert_html_class(none, 'b', 'a', 'a')
|
21
21
|
|
22
22
|
single = 'z-class'
|
23
23
|
assert_equal 'z-class', subject.insert_html_class(single)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deas-erbtags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|