undies 3.0.0.rc.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.gitignore +17 -3
  2. data/Gemfile +7 -4
  3. data/{LICENSE → LICENSE.txt} +0 -0
  4. data/README.md +107 -105
  5. data/Rakefile +1 -8
  6. data/lib/undies/api.rb +2 -1
  7. data/lib/undies/element.rb +43 -81
  8. data/lib/undies/element_node.rb +6 -5
  9. data/lib/undies/io.rb +0 -1
  10. data/lib/undies/raw.rb +15 -0
  11. data/lib/undies/source.rb +0 -8
  12. data/lib/undies/version.rb +1 -1
  13. data/lib/undies.rb +4 -2
  14. data/test/helper.rb +5 -85
  15. data/test/support/element.rb +79 -0
  16. data/test/{templates → support/templates}/content.html.rb +0 -0
  17. data/test/{templates → support/templates}/index.html.rb +0 -0
  18. data/test/{templates → support/templates}/layout.html.rb +0 -0
  19. data/test/{templates → support/templates}/test.html.rb +0 -0
  20. data/test/{element_closed_test.rb → unit/element_closed_tests.rb} +2 -6
  21. data/test/{element_node_test.rb → unit/element_node_tests.rb} +5 -11
  22. data/test/{element_open_test.rb → unit/element_open_tests.rb} +2 -5
  23. data/test/{element_test.rb → unit/element_tests.rb} +1 -2
  24. data/test/{io_test.rb → unit/io_tests.rb} +3 -8
  25. data/test/{named_source_test.rb → unit/named_source_tests.rb} +4 -5
  26. data/test/{raw_test.rb → unit/raw_tests.rb} +6 -5
  27. data/test/{root_node_test.rb → unit/root_node_tests.rb} +4 -3
  28. data/test/{source_stack_test.rb → unit/source_stack_tests.rb} +2 -3
  29. data/test/{source_test.rb → unit/source_tests.rb} +5 -6
  30. data/test/{template_builder_render_test.rb → unit/template_builder_render_tests.rb} +3 -0
  31. data/test/{template_source_render_test.rb → unit/template_source_render_tests.rb} +5 -10
  32. data/test/{template_test.rb → unit/template_tests.rb} +12 -30
  33. data/undies.gemspec +16 -18
  34. metadata +58 -111
  35. data/Gemfile.lock +0 -48
  36. data/test/fixtures/write_thing.rb +0 -21
  37. data/test/irb.rb +0 -9
@@ -1,11 +1,12 @@
1
1
  require "assert"
2
2
  require "undies/template"
3
3
 
4
- class Undies::Template
5
-
4
+ require 'undies/io'
5
+ require 'undies/source'
6
6
 
7
+ class Undies::Template
7
8
 
8
- class BasicTests < Assert::Context
9
+ class UnitTests < Assert::Context
9
10
  desc 'a template'
10
11
  before do
11
12
  @src = Undies::Source.new(Proc.new {})
@@ -54,9 +55,7 @@ class Undies::Template
54
55
 
55
56
  end
56
57
 
57
-
58
-
59
- class PlainTextTests < BasicTests
58
+ class PlainTextTests < UnitTests
60
59
  before do
61
60
  @data = "stuff & <em>more stuff</em>"
62
61
  end
@@ -73,9 +72,7 @@ class Undies::Template
73
72
 
74
73
  end
75
74
 
76
-
77
-
78
- class PlainTextTests < BasicTests
75
+ class PlainTextTests < UnitTests
79
76
  desc "with text data"
80
77
  before do
81
78
  @data = "stuff & <em>more stuff</em>"
@@ -90,9 +87,7 @@ class Undies::Template
90
87
 
91
88
  end
92
89
 
93
-
94
-
95
- class CapturedElementTests < BasicTests
90
+ class CapturedElementTests < UnitTests
96
91
  desc "using the captured element api methods"
97
92
 
98
93
  should "capture `element` output as Raw output" do
@@ -118,9 +113,7 @@ class Undies::Template
118
113
 
119
114
  end
120
115
 
121
-
122
-
123
- class StreamedElementTests < BasicTests
116
+ class StreamedElementTests < UnitTests
124
117
  desc "using the streamed element api methods"
125
118
 
126
119
  should "stream `element` output" do
@@ -150,9 +143,7 @@ class Undies::Template
150
143
 
151
144
  end
152
145
 
153
-
154
-
155
- class BuildAttrsTests < BasicTests
146
+ class BuildAttrsTests < UnitTests
156
147
 
157
148
  should "modify attributes during a build using the __attrs method" do
158
149
  subject.__element(:div)
@@ -209,9 +200,7 @@ class Undies::Template
209
200
 
210
201
  end
211
202
 
212
-
213
-
214
- class LocalDataTests < BasicTests
203
+ class LocalDataTests < UnitTests
215
204
 
216
205
  should "accept a hash of data and apply them to the template scope as instance variables" do
217
206
  t = Undies::Template.new(Undies::Source.new(Proc.new {}), {:some => 'data'}, @io)
@@ -220,9 +209,7 @@ class Undies::Template
220
209
 
221
210
  end
222
211
 
223
-
224
-
225
- class StreamTests < BasicTests
212
+ class StreamTests < UnitTests
226
213
  desc "that is streaming"
227
214
 
228
215
  before do
@@ -257,9 +244,7 @@ class Undies::Template
257
244
 
258
245
  end
259
246
 
260
-
261
-
262
- class PrettyPrintTests < BasicTests
247
+ class PrettyPrintTests < UnitTests
263
248
 
264
249
  should "generate pretty printed markup" do
265
250
  output = Undies::IO.new(@out = "", :pp => 2)
@@ -287,7 +272,4 @@ class Undies::Template
287
272
 
288
273
  end
289
274
 
290
-
291
-
292
275
  end
293
-
data/undies.gemspec CHANGED
@@ -1,25 +1,23 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
4
  require "undies/version"
4
5
 
5
- Gem::Specification.new do |s|
6
- s.name = "undies"
7
- s.version = Undies::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ["Kelly Redding"]
10
- s.email = ["kelly@kelredd.com"]
11
- s.homepage = "http://github.com/kelredd/undies"
12
- s.summary = %q{A pure-Ruby DSL for streaming templated HTML, XML, or plain text. Named for its gratuitous use of the underscore.}
13
- s.description = %q{A pure-Ruby DSL for streaming templated HTML, XML, or plain text. Named for its gratuitous use of the underscore.}
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "undies"
8
+ gem.version = Undies::VERSION
9
+ gem.authors = ["Kelly Redding"]
10
+ gem.email = ["kelly@kellyredding.com"]
11
+ gem.description = %q{A pure-Ruby DSL for streaming templated HTML, XML, or plain text.}
12
+ gem.summary = %q{A pure-Ruby DSL for streaming templated HTML, XML, or plain text.}
13
+ gem.homepage = "http://github.com/kellyredding/undies"
14
+ gem.license = 'MIT'
14
15
 
15
- s.files = `git ls-files`.split("\n")
16
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
- s.require_paths = ["lib"]
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
19
20
 
20
- s.add_development_dependency("bundler", ["~> 1.0"])
21
- s.add_development_dependency("assert", ["~> 0.7.3"])
22
- s.add_development_dependency("assert-view", ["~> 0.6"])
23
- s.add_development_dependency("whysoslow", ["~> 0.0"])
21
+ gem.add_development_dependency("assert")
24
22
 
25
23
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: undies
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424115
5
- prerelease: 6
4
+ hash: 7
5
+ prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
- - rc
11
- - 3
12
- version: 3.0.0.rc.3
10
+ version: 3.0.0
13
11
  platform: ruby
14
12
  authors:
15
13
  - Kelly Redding
@@ -17,72 +15,25 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2012-04-21 00:00:00 Z
18
+ date: 2013-07-20 00:00:00 Z
21
19
  dependencies:
22
20
  - !ruby/object:Gem::Dependency
23
- type: :development
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 15
30
- segments:
31
- - 1
32
- - 0
33
- version: "1.0"
34
- name: bundler
35
- version_requirements: *id001
36
- prerelease: false
37
- - !ruby/object:Gem::Dependency
38
- type: :development
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 5
45
- segments:
46
- - 0
47
- - 7
48
- - 3
49
- version: 0.7.3
50
21
  name: assert
51
- version_requirements: *id002
52
22
  prerelease: false
53
- - !ruby/object:Gem::Dependency
54
- type: :development
55
- requirement: &id003 !ruby/object:Gem::Requirement
23
+ requirement: &id001 !ruby/object:Gem::Requirement
56
24
  none: false
57
25
  requirements:
58
- - - ~>
26
+ - - ">="
59
27
  - !ruby/object:Gem::Version
60
- hash: 7
28
+ hash: 3
61
29
  segments:
62
30
  - 0
63
- - 6
64
- version: "0.6"
65
- name: assert-view
66
- version_requirements: *id003
67
- prerelease: false
68
- - !ruby/object:Gem::Dependency
31
+ version: "0"
69
32
  type: :development
70
- requirement: &id004 !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 11
76
- segments:
77
- - 0
78
- - 0
79
- version: "0.0"
80
- name: whysoslow
81
- version_requirements: *id004
82
- prerelease: false
83
- description: A pure-Ruby DSL for streaming templated HTML, XML, or plain text. Named for its gratuitous use of the underscore.
33
+ version_requirements: *id001
34
+ description: A pure-Ruby DSL for streaming templated HTML, XML, or plain text.
84
35
  email:
85
- - kelly@kelredd.com
36
+ - kelly@kellyredding.com
86
37
  executables: []
87
38
 
88
39
  extensions: []
@@ -93,8 +44,7 @@ files:
93
44
  - .gitignore
94
45
  - ARCH.md
95
46
  - Gemfile
96
- - Gemfile.lock
97
- - LICENSE
47
+ - LICENSE.txt
98
48
  - README.md
99
49
  - Rakefile
100
50
  - bench/bench
@@ -116,34 +66,34 @@ files:
116
66
  - lib/undies/element.rb
117
67
  - lib/undies/element_node.rb
118
68
  - lib/undies/io.rb
69
+ - lib/undies/raw.rb
119
70
  - lib/undies/root_node.rb
120
71
  - lib/undies/source.rb
121
72
  - lib/undies/template.rb
122
73
  - lib/undies/version.rb
123
- - test/element_closed_test.rb
124
- - test/element_node_test.rb
125
- - test/element_open_test.rb
126
- - test/element_test.rb
127
- - test/fixtures/write_thing.rb
128
74
  - test/helper.rb
129
- - test/io_test.rb
130
- - test/irb.rb
131
- - test/named_source_test.rb
132
- - test/raw_test.rb
133
- - test/root_node_test.rb
134
- - test/source_stack_test.rb
135
- - test/source_test.rb
136
- - test/template_builder_render_test.rb
137
- - test/template_source_render_test.rb
138
- - test/template_test.rb
139
- - test/templates/content.html.rb
140
- - test/templates/index.html.rb
141
- - test/templates/layout.html.rb
142
- - test/templates/test.html.rb
75
+ - test/support/element.rb
76
+ - test/support/templates/content.html.rb
77
+ - test/support/templates/index.html.rb
78
+ - test/support/templates/layout.html.rb
79
+ - test/support/templates/test.html.rb
80
+ - test/unit/element_closed_tests.rb
81
+ - test/unit/element_node_tests.rb
82
+ - test/unit/element_open_tests.rb
83
+ - test/unit/element_tests.rb
84
+ - test/unit/io_tests.rb
85
+ - test/unit/named_source_tests.rb
86
+ - test/unit/raw_tests.rb
87
+ - test/unit/root_node_tests.rb
88
+ - test/unit/source_stack_tests.rb
89
+ - test/unit/source_tests.rb
90
+ - test/unit/template_builder_render_tests.rb
91
+ - test/unit/template_source_render_tests.rb
92
+ - test/unit/template_tests.rb
143
93
  - undies.gemspec
144
- homepage: http://github.com/kelredd/undies
145
- licenses: []
146
-
94
+ homepage: http://github.com/kellyredding/undies
95
+ licenses:
96
+ - MIT
147
97
  post_install_message:
148
98
  rdoc_options: []
149
99
 
@@ -161,39 +111,36 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
111
  required_rubygems_version: !ruby/object:Gem::Requirement
162
112
  none: false
163
113
  requirements:
164
- - - ">"
114
+ - - ">="
165
115
  - !ruby/object:Gem::Version
166
- hash: 25
116
+ hash: 3
167
117
  segments:
168
- - 1
169
- - 3
170
- - 1
171
- version: 1.3.1
118
+ - 0
119
+ version: "0"
172
120
  requirements: []
173
121
 
174
122
  rubyforge_project:
175
- rubygems_version: 1.8.11
123
+ rubygems_version: 1.8.24
176
124
  signing_key:
177
125
  specification_version: 3
178
- summary: A pure-Ruby DSL for streaming templated HTML, XML, or plain text. Named for its gratuitous use of the underscore.
126
+ summary: A pure-Ruby DSL for streaming templated HTML, XML, or plain text.
179
127
  test_files:
180
- - test/element_closed_test.rb
181
- - test/element_node_test.rb
182
- - test/element_open_test.rb
183
- - test/element_test.rb
184
- - test/fixtures/write_thing.rb
185
128
  - test/helper.rb
186
- - test/io_test.rb
187
- - test/irb.rb
188
- - test/named_source_test.rb
189
- - test/raw_test.rb
190
- - test/root_node_test.rb
191
- - test/source_stack_test.rb
192
- - test/source_test.rb
193
- - test/template_builder_render_test.rb
194
- - test/template_source_render_test.rb
195
- - test/template_test.rb
196
- - test/templates/content.html.rb
197
- - test/templates/index.html.rb
198
- - test/templates/layout.html.rb
199
- - test/templates/test.html.rb
129
+ - test/support/element.rb
130
+ - test/support/templates/content.html.rb
131
+ - test/support/templates/index.html.rb
132
+ - test/support/templates/layout.html.rb
133
+ - test/support/templates/test.html.rb
134
+ - test/unit/element_closed_tests.rb
135
+ - test/unit/element_node_tests.rb
136
+ - test/unit/element_open_tests.rb
137
+ - test/unit/element_tests.rb
138
+ - test/unit/io_tests.rb
139
+ - test/unit/named_source_tests.rb
140
+ - test/unit/raw_tests.rb
141
+ - test/unit/root_node_tests.rb
142
+ - test/unit/source_stack_tests.rb
143
+ - test/unit/source_tests.rb
144
+ - test/unit/template_builder_render_tests.rb
145
+ - test/unit/template_source_render_tests.rb
146
+ - test/unit/template_tests.rb
data/Gemfile.lock DELETED
@@ -1,48 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- undies (3.0.0.rc.3)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- ansi (1.4.2)
10
- assert (0.7.3)
11
- assert-view (~> 0.5)
12
- assert-view (0.6.0)
13
- ansi (~> 1.3)
14
- builder (3.0.0)
15
- erector (0.8.3)
16
- rake
17
- rake
18
- treetop
19
- treetop (>= 1.2.3)
20
- erubis (2.7.0)
21
- haml (3.1.4)
22
- markaby (0.7.2)
23
- builder (>= 2.0.0)
24
- polyglot (0.3.3)
25
- rake (0.9.2)
26
- ruby-prof (0.10.8)
27
- treetop (1.4.10)
28
- polyglot
29
- polyglot (>= 0.3.1)
30
- whysoslow (0.0.2)
31
- ansi (~> 1.4)
32
-
33
- PLATFORMS
34
- ruby
35
-
36
- DEPENDENCIES
37
- ansi
38
- assert (~> 0.7.3)
39
- assert-view (~> 0.6)
40
- bundler (~> 1.0)
41
- erector
42
- erubis
43
- haml
44
- markaby
45
- rake (~> 0.9.2)
46
- ruby-prof
47
- undies!
48
- whysoslow (~> 0.0)
@@ -1,21 +0,0 @@
1
- class WriteThing
2
-
3
- # this is used in testing the write buffer
4
-
5
- def __hi
6
- 'hi'
7
- end
8
-
9
- def __hello
10
- 'hello'
11
- end
12
-
13
- def __hithere
14
- 'hithere'
15
- end
16
-
17
- def __prefix(meth, level, indent)
18
- "#{level > 0 ? "\n": ''}#{' '*level*indent}"
19
- end
20
-
21
- end
data/test/irb.rb DELETED
@@ -1,9 +0,0 @@
1
- require 'assert/setup'
2
-
3
- # this file is required in when the 'irb' rake test is run.
4
- # b/c 'assert' is required above, the test helper will be
5
- # required in.
6
-
7
- # put any IRB setup code here
8
-
9
- require 'undies'