element_factory 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/element_factory.gemspec +1 -1
- data/lib/element_factory/element.rb +3 -3
- data/lib/element_factory/version.rb +1 -1
- data/spec/lib/element_spec.rb +4 -0
- metadata +12 -6
data/element_factory.gemspec
CHANGED
@@ -35,15 +35,15 @@ module ElementFactory
|
|
35
35
|
|
36
36
|
def tag_start
|
37
37
|
tag_attributes = attributes.any?? " #{html_attributes}" : ""
|
38
|
-
%|<%s%s>| % [name, tag_attributes]
|
38
|
+
(%|<%s%s>| % [name, tag_attributes]).html_safe
|
39
39
|
end
|
40
40
|
|
41
41
|
def tag_end
|
42
|
-
%|</%s>| % name
|
42
|
+
(%|</%s>| % name).html_safe
|
43
43
|
end
|
44
44
|
|
45
45
|
def tag_middle
|
46
|
-
children.map(&:to_html).join
|
46
|
+
(children.map(&:to_html).join).html_safe
|
47
47
|
end
|
48
48
|
|
49
49
|
private
|
data/spec/lib/element_spec.rb
CHANGED
@@ -64,6 +64,10 @@ describe ElementFactory::Element do
|
|
64
64
|
expect(subject.to_html).to match /<table(.*)>(.*)<\/table>/
|
65
65
|
end
|
66
66
|
|
67
|
+
it "returns an html safe string" do
|
68
|
+
expect(subject.to_html).to be_html_safe
|
69
|
+
end
|
70
|
+
|
67
71
|
it "returns the tag with attributes" do
|
68
72
|
element = to_element(subject.to_html, "table")
|
69
73
|
expect(element[:class]).to eq("a-class")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: element_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -144,17 +144,23 @@ dependencies:
|
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
145
145
|
none: false
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '3.1'
|
150
|
+
- - <
|
148
151
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
152
|
+
version: '4.1'
|
150
153
|
type: :runtime
|
151
154
|
prerelease: false
|
152
155
|
version_requirements: !ruby/object:Gem::Requirement
|
153
156
|
none: false
|
154
157
|
requirements:
|
155
|
-
- -
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '3.1'
|
161
|
+
- - <
|
156
162
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
163
|
+
version: '4.1'
|
158
164
|
description: Element Factory is a more object oriented approach to generating markup.
|
159
165
|
email:
|
160
166
|
- robert@creativequeries.com
|