BodyBuilder 0.2.0 → 0.2.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/BodyBuilder.gemspec +2 -2
- data/README +21 -17
- data/lib/body_builder.rb +1 -1
- metadata +3 -3
data/BodyBuilder.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{BodyBuilder}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Exiquio Cooper-Anderson"]
|
9
|
-
s.date = %q{
|
9
|
+
s.date = %q{2011-09-25}
|
10
10
|
s.description = %q{XHMTL 1.1 generator}
|
11
11
|
s.email = %q{exiquio @nospam@ gmail.com}
|
12
12
|
s.extra_rdoc_files = ["README", "lib/body_builder.rb", "lib/hash.rb", "lib/object.rb"]
|
data/README
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
BodyBuilder (Version 0.
|
1
|
+
BodyBuilder (Version 0.2.0)
|
2
2
|
|
3
3
|
Ruby XHTML 1.1 Generator
|
4
4
|
|
@@ -7,41 +7,45 @@ Copyright: (C) 2010 Exiquio Cooper-Anderson
|
|
7
7
|
License: GPLv3 (www.gnu.org/licenses/gpl.html)
|
8
8
|
|
9
9
|
Requirements:
|
10
|
-
|
10
|
+
Ruby 1.9.*
|
11
11
|
|
12
12
|
Installation:
|
13
|
-
|
13
|
+
gem install BodyBuilder
|
14
14
|
|
15
15
|
Usage:
|
16
16
|
|
17
|
-
{{{
|
18
|
-
|
19
17
|
#!/usr/bin/env ruby
|
20
18
|
|
21
|
-
require 'rubygems'
|
19
|
+
require 'rubygems' # I never do this
|
22
20
|
require 'body_builder'
|
23
21
|
|
22
|
+
# HeMan does the heavy lifting
|
24
23
|
c = BodyBuilder::HeMan.new
|
24
|
+
# All tag methods follow this pattern
|
25
|
+
# c.p translates to '<p>'
|
26
|
+
# c.p_ translates to '</p>'
|
27
|
+
# c._p_ translates to '<p></p>'
|
28
|
+
# methods like :p and :_p_ take an optional String of attributes
|
29
|
+
# as their first argument and an optional String value as its second.
|
30
|
+
# See: http://rubydoc.info/gems/BodyBuilder/0.2.0/BodyBuilder/Skeletor#initialize-instance_method
|
25
31
|
c.div 'id="main_content"'
|
26
32
|
c._p_ '', 'Hello, world!'
|
27
33
|
c._hr_
|
28
34
|
c._p_ '', 'Generated with BodyBuilder'
|
29
35
|
c.div_
|
30
36
|
|
37
|
+
# Skeletor is a barebone XHTML document
|
31
38
|
puts BodyBuilder::Skeletor.new(
|
32
39
|
{
|
33
40
|
title: 'Hello, world',
|
34
|
-
body: c,
|
41
|
+
body: c, # You feed body a String or a HeMan object.
|
35
42
|
icon: {href: '/public/images/icon.png', type: 'media/png'}
|
36
43
|
}
|
37
44
|
).render
|
38
45
|
|
39
|
-
}}}
|
40
46
|
|
41
47
|
Results:
|
42
48
|
|
43
|
-
{{{
|
44
|
-
|
45
49
|
<?xml version="1.0" encoding="UTF-8"?>
|
46
50
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
47
51
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
@@ -58,17 +62,17 @@ Results:
|
|
58
62
|
</body>
|
59
63
|
</html>
|
60
64
|
|
61
|
-
}}}
|
62
65
|
|
63
66
|
Latest change:
|
64
|
-
2010-12-11 - Refactored, XHTML 1.1 implementation complete, brought in ExLib, version changed to 0.1.9, decided against HTML5 implementation
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
-
|
68
|
+
2010-12-12 - Refactored, fixed bugs, implmented riot beheavior tests, benchmarked, version upped to 0.2.0
|
69
|
+
|
70
|
+
TODO: See Issues
|
71
|
+
|
69
72
|
|
70
73
|
NOTE:
|
71
|
-
|
72
|
-
|
74
|
+
|
75
|
+
'document type does not allow element 'script' here'
|
76
|
+
Validation causes the above error because scripts are loading at the end of the XHTML document for performance.
|
73
77
|
|
74
78
|
Any questions, conscerns or commments: exiquio [at] gmail [dot] com
|
data/lib/body_builder.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Exiquio Cooper-Anderson
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-09-25 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|