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.
@@ -31,8 +31,8 @@ module Deas::ErbTags
31
31
  end.join
32
32
  end
33
33
 
34
- def self.insert_html_class(current_class_str, *classes_to_insert)
35
- (Set.new(current_class_str.split(' ')) + classes_to_insert).sort.join(' ')
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
@@ -1,4 +1,4 @@
1
1
  module Deas; end
2
2
  module Deas::ErbTags
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
@@ -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: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Redding