smtlaissezfaire-simply 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Rakefile +4 -4
- data/VERSION.yml +2 -2
- data/benchmarks/001_7a22450a80d6253bf9f0aabb2ee0110c2d67c8a6.out +23 -0
- data/benchmarks/002_e462499cd6bd8dface62e433311b3bc0b0b55a42 +27 -0
- data/benchmarks/003_fd604401b1b03096ec35cdb3036821b92a71791b.out +27 -0
- data/benchmarks/004_b75e031f96b342559036444f502d44da7e7104f0.out +27 -0
- data/benchmarks/comparison.rb +224 -0
- data/lib/simply.rb +1 -2
- data/lib/simply/escaping.rb +20 -0
- data/lib/simply/html_builder.rb +3 -6
- data/lib/simply/version.rb +3 -1
- data/profiling/run_static.rb +18 -0
- data/profiling/run_static_001_0e246c3de41a891c206c8cb5a552d17d78e4b8ec.out +157 -0
- data/reference/ABOUT +5 -0
- data/reference/xhtml1-frameset.xsd +2847 -0
- data/reference/xhtml1-strict.xsd +2211 -0
- data/reference/xhtml1-transitional.xsd +2755 -0
- data/simply.gemspec +72 -0
- data/spec/simply/html_builder/indentation_spec.rb +7 -7
- data/spec/simply/html_builder/locals_spec.rb +14 -3
- data/spec/simply/html_builder_spec.rb +13 -1
- data/spec/simply/version_spec.rb +2 -2
- metadata +23 -8
data/simply.gemspec
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{simply}
|
5
|
+
s.version = "0.2.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Scott Taylor"]
|
9
|
+
s.date = %q{2009-07-29}
|
10
|
+
s.description = %q{A minimal markaby-esq ruby templating language}
|
11
|
+
s.email = %q{scott@railsnewbie.com}
|
12
|
+
s.extra_rdoc_files = [
|
13
|
+
"README"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
".gitignore",
|
17
|
+
"README",
|
18
|
+
"Rakefile",
|
19
|
+
"VERSION.yml",
|
20
|
+
"benchmarks/001_7a22450a80d6253bf9f0aabb2ee0110c2d67c8a6.out",
|
21
|
+
"benchmarks/002_e462499cd6bd8dface62e433311b3bc0b0b55a42",
|
22
|
+
"benchmarks/003_fd604401b1b03096ec35cdb3036821b92a71791b.out",
|
23
|
+
"benchmarks/004_b75e031f96b342559036444f502d44da7e7104f0.out",
|
24
|
+
"benchmarks/comparison.rb",
|
25
|
+
"lib/simply.rb",
|
26
|
+
"lib/simply/escaping.rb",
|
27
|
+
"lib/simply/html_builder.rb",
|
28
|
+
"lib/simply/html_tags.rb",
|
29
|
+
"lib/simply/indentation.rb",
|
30
|
+
"lib/simply/locals.rb",
|
31
|
+
"lib/simply/version.rb",
|
32
|
+
"profiling/run_static.rb",
|
33
|
+
"profiling/run_static_001_0e246c3de41a891c206c8cb5a552d17d78e4b8ec.out",
|
34
|
+
"reference/ABOUT",
|
35
|
+
"reference/xhtml1-frameset.xsd",
|
36
|
+
"reference/xhtml1-strict.xsd",
|
37
|
+
"reference/xhtml1-transitional.xsd",
|
38
|
+
"simply.gemspec",
|
39
|
+
"spec/simply/html_builder/indentation_spec.rb",
|
40
|
+
"spec/simply/html_builder/locals_spec.rb",
|
41
|
+
"spec/simply/html_builder_spec.rb",
|
42
|
+
"spec/simply/indentation_spec.rb",
|
43
|
+
"spec/simply/simply_spec.rb",
|
44
|
+
"spec/simply/version_spec.rb",
|
45
|
+
"spec/spec.opts",
|
46
|
+
"spec/spec_helper.rb"
|
47
|
+
]
|
48
|
+
s.homepage = %q{http://github.com/smtlaissezfaire/simply}
|
49
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
50
|
+
s.require_paths = ["lib"]
|
51
|
+
s.rubygems_version = %q{1.3.4}
|
52
|
+
s.summary = %q{A minimal markaby-esq ruby templating language}
|
53
|
+
s.test_files = [
|
54
|
+
"spec/simply/html_builder/indentation_spec.rb",
|
55
|
+
"spec/simply/html_builder/locals_spec.rb",
|
56
|
+
"spec/simply/html_builder_spec.rb",
|
57
|
+
"spec/simply/indentation_spec.rb",
|
58
|
+
"spec/simply/simply_spec.rb",
|
59
|
+
"spec/simply/version_spec.rb",
|
60
|
+
"spec/spec_helper.rb"
|
61
|
+
]
|
62
|
+
|
63
|
+
if s.respond_to? :specification_version then
|
64
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
65
|
+
s.specification_version = 3
|
66
|
+
|
67
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
68
|
+
else
|
69
|
+
end
|
70
|
+
else
|
71
|
+
end
|
72
|
+
end
|
@@ -3,22 +3,22 @@ require File.dirname(__FILE__) + "/../../spec_helper"
|
|
3
3
|
module Simply
|
4
4
|
describe HTMLBuilder, "with indentation" do
|
5
5
|
before(:each) do
|
6
|
-
@builder = HTMLBuilder.new(:
|
6
|
+
@builder = HTMLBuilder.new(:indented => true)
|
7
7
|
end
|
8
8
|
|
9
|
-
it "should be indented when passed :
|
10
|
-
builder = HTMLBuilder.new(:
|
9
|
+
it "should be indented when passed :indented => true" do
|
10
|
+
builder = HTMLBuilder.new(:indented => true)
|
11
11
|
builder.should be_indented
|
12
12
|
end
|
13
13
|
|
14
|
-
it "should not be indented when passed :
|
15
|
-
builder = HTMLBuilder.new(:
|
14
|
+
it "should not be indented when passed :indented => false" do
|
15
|
+
builder = HTMLBuilder.new(:indented => false)
|
16
16
|
builder.should_not be_indented
|
17
17
|
end
|
18
18
|
|
19
|
-
it "should
|
19
|
+
it "should be indented by default" do
|
20
20
|
builder = HTMLBuilder.new
|
21
|
-
builder.
|
21
|
+
builder.should be_indented
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should indent html when indented = true, and given a block structure" do
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../../spec_helper"
|
|
3
3
|
module Simply
|
4
4
|
describe HTMLBuilder, "with locals" do
|
5
5
|
before(:each) do
|
6
|
-
@builder = HTMLBuilder.new
|
6
|
+
@builder = HTMLBuilder.new(:indented => false)
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should have access to a variables value" do
|
@@ -36,7 +36,7 @@ module Simply
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should take locals in the constructor" do
|
39
|
-
builder = HTMLBuilder.new(:locals => { :foo => "bar", :bar => "baz" }) do
|
39
|
+
builder = HTMLBuilder.new(:locals => { :foo => "bar", :bar => "baz" }, :indented => false) do
|
40
40
|
ul do
|
41
41
|
li foo
|
42
42
|
li bar
|
@@ -45,5 +45,16 @@ module Simply
|
|
45
45
|
|
46
46
|
builder.to_s.should == "<ul><li>bar</li><li>baz</li></ul>"
|
47
47
|
end
|
48
|
+
|
49
|
+
it "should be able to pass in several sets of locals at different times" do
|
50
|
+
builder = HTMLBuilder.new(:locals => {:foo => "1"}, :indented => false)
|
51
|
+
builder.locals = {:bar => "2"}
|
52
|
+
builder.ul do
|
53
|
+
li foo
|
54
|
+
li bar
|
55
|
+
end
|
56
|
+
|
57
|
+
builder.to_s.should == "<ul><li>1</li><li>2</li></ul>"
|
58
|
+
end
|
48
59
|
end
|
49
|
-
end
|
60
|
+
end
|
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + "/../spec_helper"
|
|
3
3
|
module Simply
|
4
4
|
describe HTMLBuilder do
|
5
5
|
before(:each) do
|
6
|
-
@builder = HTMLBuilder.new
|
6
|
+
@builder = HTMLBuilder.new(:indented => false)
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should create a self-closing hr tag" do
|
@@ -26,6 +26,13 @@ module Simply
|
|
26
26
|
@builder.text "foo"
|
27
27
|
@builder.to_s.should == "foo"
|
28
28
|
end
|
29
|
+
|
30
|
+
it "should call to_s on the object given to text" do
|
31
|
+
obj = Object.new
|
32
|
+
obj.stub!(:to_s).and_return "foo"
|
33
|
+
@builder.text obj
|
34
|
+
@builder.to_s.should == "foo"
|
35
|
+
end
|
29
36
|
|
30
37
|
it "should have a paragraph tag" do
|
31
38
|
@builder.p "foo"
|
@@ -132,5 +139,10 @@ module Simply
|
|
132
139
|
@builder.to_s.should include('<?xml version="1.0" encoding="UTF-8"?>')
|
133
140
|
@builder.to_s.should include('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">')
|
134
141
|
end
|
142
|
+
|
143
|
+
it "should be able to build an empty node" do
|
144
|
+
@builder.text "Add Text"
|
145
|
+
@builder.to_s.should == "Add Text"
|
146
|
+
end
|
135
147
|
end
|
136
148
|
end
|
data/spec/simply/version_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smtlaissezfaire-simply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Taylor
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-29 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
16
|
+
description: A minimal markaby-esq ruby templating language
|
17
17
|
email: scott@railsnewbie.com
|
18
18
|
executables: []
|
19
19
|
|
@@ -22,14 +22,29 @@ extensions: []
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README
|
24
24
|
files:
|
25
|
+
- .gitignore
|
26
|
+
- README
|
25
27
|
- Rakefile
|
26
28
|
- VERSION.yml
|
29
|
+
- benchmarks/001_7a22450a80d6253bf9f0aabb2ee0110c2d67c8a6.out
|
30
|
+
- benchmarks/002_e462499cd6bd8dface62e433311b3bc0b0b55a42
|
31
|
+
- benchmarks/003_fd604401b1b03096ec35cdb3036821b92a71791b.out
|
32
|
+
- benchmarks/004_b75e031f96b342559036444f502d44da7e7104f0.out
|
33
|
+
- benchmarks/comparison.rb
|
27
34
|
- lib/simply.rb
|
35
|
+
- lib/simply/escaping.rb
|
28
36
|
- lib/simply/html_builder.rb
|
29
37
|
- lib/simply/html_tags.rb
|
30
38
|
- lib/simply/indentation.rb
|
31
39
|
- lib/simply/locals.rb
|
32
40
|
- lib/simply/version.rb
|
41
|
+
- profiling/run_static.rb
|
42
|
+
- profiling/run_static_001_0e246c3de41a891c206c8cb5a552d17d78e4b8ec.out
|
43
|
+
- reference/ABOUT
|
44
|
+
- reference/xhtml1-frameset.xsd
|
45
|
+
- reference/xhtml1-strict.xsd
|
46
|
+
- reference/xhtml1-transitional.xsd
|
47
|
+
- simply.gemspec
|
33
48
|
- spec/simply/html_builder/indentation_spec.rb
|
34
49
|
- spec/simply/html_builder/locals_spec.rb
|
35
50
|
- spec/simply/html_builder_spec.rb
|
@@ -38,9 +53,9 @@ files:
|
|
38
53
|
- spec/simply/version_spec.rb
|
39
54
|
- spec/spec.opts
|
40
55
|
- spec/spec_helper.rb
|
41
|
-
|
42
|
-
has_rdoc: true
|
56
|
+
has_rdoc: false
|
43
57
|
homepage: http://github.com/smtlaissezfaire/simply
|
58
|
+
licenses:
|
44
59
|
post_install_message:
|
45
60
|
rdoc_options:
|
46
61
|
- --charset=UTF-8
|
@@ -61,10 +76,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
76
|
requirements: []
|
62
77
|
|
63
78
|
rubyforge_project:
|
64
|
-
rubygems_version: 1.
|
79
|
+
rubygems_version: 1.3.5
|
65
80
|
signing_key:
|
66
|
-
specification_version:
|
67
|
-
summary:
|
81
|
+
specification_version: 3
|
82
|
+
summary: A minimal markaby-esq ruby templating language
|
68
83
|
test_files:
|
69
84
|
- spec/simply/html_builder/indentation_spec.rb
|
70
85
|
- spec/simply/html_builder/locals_spec.rb
|