tag_helper 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -3
  3. data/lib/tag_helper.rb +4 -11
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7f6872d2d8442b16fd8d82f23fb88a70157c85b
4
- data.tar.gz: 236c708c31e978e4b924b2dd29e08cb8d2cdda25
3
+ metadata.gz: 2b420333feaa707ac8a407a5f42a13465cb5cdf4
4
+ data.tar.gz: cd3a1fed83c4bbb9d9a3407583e1f07e089764d4
5
5
  SHA512:
6
- metadata.gz: 15fe6fe63357d881f1f5fa2fcc93b5c9c469d858f682c4db0a57d631fba7616b06eb3690750e9b92779b72aec9c9a9743dc9fca3cf0747e0e4eb735d4dea8a28
7
- data.tar.gz: 3ce20e2c35af6c6b81b139583347a50737d9c615b741532bea390d617dfd6c0a3075d507f64760a65480d485eae5ee926c9e59adfcec8649584391b3e694ad90
6
+ metadata.gz: a93025b7b005d96d7be35b3e762f838755cebe473afd9c1992068be2c84256d4054aa717fd3e8e3abcc228a8c42eddd35e9adbc8c5fcd45f73b2b8b6f16e78bc
7
+ data.tar.gz: bd4120056cef2251d99271d2cc5a12b866dbf112634cd689709583b78f9a2bbfaf32ec5dda84ba984c592c2f5b190efb32c18a814bdb696f15e0802bde542eb0
data/README.md CHANGED
@@ -39,9 +39,7 @@ $ gem install tag_helper
39
39
  => "<img alt="number one!" src="1.png" />"
40
40
  ```
41
41
 
42
- ## LICENCE
43
-
44
- Licence
42
+ ## LICENSE
45
43
 
46
44
  Copyright (c) 2015 Dejan Simic
47
45
 
data/lib/tag_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'rexml/document'
2
-
3
1
  module TagHelper
4
2
 
5
3
  def image_tag(src, html_options = {})
@@ -23,10 +21,9 @@ module TagHelper
23
21
  end
24
22
 
25
23
  def content_tag(tag, value, attrs = {})
26
- b = "<#{tag_and_attributes(tag, attributes(attrs))}>"
27
- v = normalize(value)
28
- e = "</#{tag}>"
29
- [b, v, e].join
24
+ start_tag = "<#{tag_and_attributes(tag, attributes(attrs))}>"
25
+ end_tag = "</#{tag}>"
26
+ [start_tag, value, end_tag].join
30
27
  end
31
28
 
32
29
  def tag_and_attributes(tag, attributes)
@@ -36,11 +33,7 @@ module TagHelper
36
33
  def attributes(hash)
37
34
  hash.to_a.
38
35
  reject { |k,v| v.nil? }.
39
- map { |k, v| %{#{k}="#{normalize v}"} }.join(' ')
40
- end
41
-
42
- def normalize(s)
43
- REXML::Text::normalize(s)
36
+ map { |k, v| %{#{k}="#{v}"} }.join(' ')
44
37
  end
45
38
 
46
39
  extend self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tag_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dejan Simic