html_writer 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/html_writer.rb +9 -2
- metadata +2 -2
data/README.md
CHANGED
data/lib/html_writer.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
class HtmlWriter
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '0.2.0'
|
3
|
+
|
4
|
+
DEFAULT_DOCTYPE = 5
|
3
5
|
|
4
6
|
VALID_TAGS = {
|
5
7
|
5 => [
|
@@ -32,7 +34,8 @@ class HtmlWriter
|
|
32
34
|
class InvalidTagError < StandardError; end
|
33
35
|
|
34
36
|
def initialize
|
35
|
-
@html
|
37
|
+
@html = ''
|
38
|
+
@doctype = DEFAULT_DOCTYPE
|
36
39
|
end
|
37
40
|
|
38
41
|
def write
|
@@ -41,6 +44,10 @@ class HtmlWriter
|
|
41
44
|
@html << '</html>'
|
42
45
|
end
|
43
46
|
|
47
|
+
def write_inline
|
48
|
+
yield self
|
49
|
+
end
|
50
|
+
|
44
51
|
def doctype(doctype)
|
45
52
|
@doctype = doctype
|
46
53
|
case @doctype
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html_writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
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: 2012-04-
|
12
|
+
date: 2012-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: a small DSL for writing HTML
|
15
15
|
email: mportiz08@gmail.com
|