inversion 0.12.3 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -1
  3. data.tar.gz.sig +0 -0
  4. data/ChangeLog +305 -9
  5. data/Examples.rdoc +134 -0
  6. data/GettingStarted.rdoc +44 -0
  7. data/Guide.rdoc +47 -0
  8. data/History.rdoc +15 -0
  9. data/Manifest.txt +7 -2
  10. data/README.rdoc +9 -10
  11. data/Rakefile +23 -10
  12. data/Tags.rdoc +561 -0
  13. data/lib/inversion.rb +2 -2
  14. data/lib/inversion/renderstate.rb +46 -11
  15. data/lib/inversion/template.rb +85 -7
  16. data/lib/inversion/template/attrtag.rb +1 -1
  17. data/lib/inversion/template/begintag.rb +8 -8
  18. data/lib/inversion/template/fragmenttag.rb +60 -0
  19. data/lib/inversion/template/rescuetag.rb +1 -1
  20. data/spec/{lib/helpers.rb → helpers.rb} +7 -30
  21. data/spec/inversion/mixins_spec.rb +55 -65
  22. data/spec/inversion/monkeypatches_spec.rb +2 -12
  23. data/spec/inversion/parser_spec.rb +34 -44
  24. data/spec/inversion/renderstate_spec.rb +123 -69
  25. data/spec/inversion/sinatra_spec.rb +6 -19
  26. data/spec/inversion/template/attrtag_spec.rb +56 -76
  27. data/spec/inversion/template/begintag_spec.rb +24 -41
  28. data/spec/inversion/template/calltag_spec.rb +1 -18
  29. data/spec/inversion/template/codetag_spec.rb +6 -24
  30. data/spec/inversion/template/commenttag_spec.rb +9 -27
  31. data/spec/inversion/template/configtag_spec.rb +5 -16
  32. data/spec/inversion/template/containertag_spec.rb +4 -21
  33. data/spec/inversion/template/defaulttag_spec.rb +6 -23
  34. data/spec/inversion/template/elsetag_spec.rb +9 -26
  35. data/spec/inversion/template/elsiftag_spec.rb +7 -24
  36. data/spec/inversion/template/endtag_spec.rb +6 -23
  37. data/spec/inversion/template/escapetag_spec.rb +10 -25
  38. data/spec/inversion/template/fortag_spec.rb +20 -37
  39. data/spec/inversion/template/fragmenttag_spec.rb +40 -0
  40. data/spec/inversion/template/iftag_spec.rb +23 -40
  41. data/spec/inversion/template/importtag_spec.rb +8 -25
  42. data/spec/inversion/template/includetag_spec.rb +27 -42
  43. data/spec/inversion/template/node_spec.rb +6 -15
  44. data/spec/inversion/template/pptag_spec.rb +10 -23
  45. data/spec/inversion/template/publishtag_spec.rb +4 -21
  46. data/spec/inversion/template/rescuetag_spec.rb +12 -29
  47. data/spec/inversion/template/subscribetag_spec.rb +8 -25
  48. data/spec/inversion/template/tag_spec.rb +24 -37
  49. data/spec/inversion/template/textnode_spec.rb +8 -24
  50. data/spec/inversion/template/timedeltatag_spec.rb +31 -43
  51. data/spec/inversion/template/unlesstag_spec.rb +7 -24
  52. data/spec/inversion/template/uriencodetag_spec.rb +6 -23
  53. data/spec/inversion/template/yieldtag_spec.rb +3 -20
  54. data/spec/inversion/template_spec.rb +155 -108
  55. data/spec/inversion/tilt_spec.rb +7 -16
  56. data/spec/inversion_spec.rb +7 -22
  57. metadata +63 -40
  58. metadata.gz.sig +0 -0
  59. data/spec/lib/constants.rb +0 -9
@@ -1,19 +1,10 @@
1
1
  #!/usr/bin/env rspec -cfd -b
2
2
  # vim: set noet nosta sw=4 ts=4 :
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname( __FILE__ ).dirname.parent.parent
7
- libdir = basedir + 'lib'
8
-
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
12
-
13
- require 'rspec'
14
- require 'spec/lib/helpers'
4
+ require_relative '../helpers'
15
5
 
16
6
  begin
7
+ require 'tilt'
17
8
  require 'inversion/tilt'
18
9
  $tilt_support = true
19
10
  rescue LoadError => err
@@ -28,19 +19,19 @@ describe "Tilt support", :if => $tilt_support do
28
19
  end
29
20
 
30
21
  it "registers itself with Tilt" do
31
- Tilt['layout.tmpl'].should == Inversion::TiltWrapper
22
+ expect( Tilt['layout.tmpl'] ).to eq( Inversion::TiltWrapper )
32
23
  end
33
24
 
34
25
  it "merges locals with template attributes upon evaluation" do
35
- File.stub( :open ).with( 'test.tmpl', 'rb' ).and_return( '<?attr foo ?>' )
36
- Tilt.new( 'test.tmpl' ).render( Object.new, :foo => 'Booyakasha!' ).should == 'Booyakasha!'
26
+ expect( File ).to receive( :open ).with( 'test.tmpl', 'rb' ).and_return( '<?attr foo ?>' )
27
+ expect( Tilt.new( 'test.tmpl' ).render( Object.new, :foo => 'Booyakasha!' ) ).to eq( 'Booyakasha!' )
37
28
  end
38
29
 
39
30
  it "merges the 'scope' object if it responds_to #to_h" do
40
31
  scope = Object.new
41
32
  def scope.to_h; { :message => "Respek!" }; end
42
- File.stub( :open ).with( 'test.tmpl', 'rb' ).and_return( '<?attr message ?>' )
43
- Tilt.new( 'test.tmpl' ).render( scope, {} ).should == 'Respek!'
33
+ expect( File ).to receive( :open ).with( 'test.tmpl', 'rb' ).and_return( '<?attr message ?>' )
34
+ expect( Tilt.new( 'test.tmpl' ).render( scope, {} ) ).to eq( 'Respek!' )
44
35
  end
45
36
 
46
37
  end
@@ -1,42 +1,27 @@
1
1
  #!/usr/bin/env rspec -cfd -b
2
2
  # vim: set noet nosta sw=4 ts=4 :
3
3
 
4
- BEGIN {
5
- require 'pathname'
6
- basedir = Pathname( __FILE__ ).dirname.parent
7
- libdir = basedir + 'lib'
4
+ require_relative 'helpers'
8
5
 
9
- $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
10
- $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
11
- }
12
-
13
- require 'rspec'
14
- require 'spec/lib/helpers'
15
6
  require 'inversion'
16
7
 
17
8
  describe Inversion do
18
9
 
19
- before( :all ) do
20
- setup_logging( :fatal )
21
- end
22
-
23
- after( :each ) do
24
- reset_logging()
25
- end
26
-
27
-
28
10
  it "defines a version" do
29
- Inversion::VERSION.should =~ /^\d+(\.\d+)*$/
11
+ expect( described_class::VERSION ).to match( /^\d+(\.\d+)*$/ )
30
12
  end
31
13
 
14
+
32
15
  describe "version methods" do
33
16
 
34
17
  it "returns a version string if asked" do
35
- Inversion.version_string.should =~ /\w+ [\d.]+/
18
+ expect( described_class.version_string ).to match( /\w+ [\d.]+/ )
36
19
  end
37
20
 
38
21
  it "returns a version string with a build number if asked" do
39
- Inversion.version_string(true).should =~ /\w+ [\d.]+ \(build [[:xdigit:]]+\)/
22
+ expect(
23
+ described_class.version_string(true)
24
+ ).to match( /\w+ [\d.]+ \(build [[:xdigit:]]+\)/ )
40
25
  end
41
26
  end
42
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -13,7 +13,7 @@ cert_chain:
13
13
  -----BEGIN CERTIFICATE-----
14
14
  MIIDbDCCAlSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQwwCgYDVQQDDANnZWQx
15
15
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
16
- HhcNMTMwMjI3MTY0ODU4WhcNMTQwMjI3MTY0ODU4WjA+MQwwCgYDVQQDDANnZWQx
16
+ HhcNMTQwMzE5MDQzNTI2WhcNMTUwMzE5MDQzNTI2WjA+MQwwCgYDVQQDDANnZWQx
17
17
  GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
18
18
  ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDb92mkyYwuGBg1oRxt2tkH
19
19
  +Uo3LAsaL/APBfSLzy8o3+B3AUHKCjMUaVeBoZdWtMHB75X3VQlvXfZMyBxj59Vo
@@ -24,14 +24,14 @@ cert_chain:
24
24
  AgMBAAGjdTBzMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBSZ0hCV
25
25
  qoHr122fGKelqffzEQBhszAcBgNVHREEFTATgRFnZWRARmFlcmllTVVELm9yZzAc
26
26
  BgNVHRIEFTATgRFnZWRARmFlcmllTVVELm9yZzANBgkqhkiG9w0BAQUFAAOCAQEA
27
- Vlcfyq6GwyE8i0QuFPCeVOwJaneSvcwx316DApjy9/tt2YD2HomLbtpXtji5QXor
28
- ON6oln4tWBIB3Klbr3szq5oR3Rc1D02SaBTalxSndp4M6UkW9hRFu5jn98pDB4fq
29
- 5l8wMMU0Xdmqx1VYvysVAjVFVC/W4NNvlmg+2mEgSVZP5K6Tc9qDh3eMQInoYw6h
30
- t1YA6RsUJHp5vGQyhP1x34YpLAaly8icbns/8PqOf7Osn9ztmg8bOMJCeb32eQLj
31
- 6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
32
- /YSusaiDXHKU2O3Akc3htA==
27
+ TuL1Bzl6TBs1YEzEubFHb9XAPgehWzzUudjDKzTRd+uyZmxnomBqTCQjT5ucNRph
28
+ 3jZ6bhLNooLQxTjIuHodeGcEMHZdt4Yi7SyPmw5Nry12z6wrDp+5aGps3HsE5WsQ
29
+ Zq2EuyEOc96g31uoIvjNdieKs+1kE+K+dJDjtw+wTH2i63P7r6N/NfPPXpxsFquo
30
+ wcYRRrHdR7GhdJeT+V8Q8Bi5bglCUGdx+8scMgkkePc98k9osQHypbACmzO+Bqkv
31
+ c7ZKPJcWBv0sm81+FCZXNACn2f9jfF8OQinxVs0O052KbGuEQaaiGIYeuuwQE2q6
32
+ ggcrPfcYeTwWlfZPu2LrBg==
33
33
  -----END CERTIFICATE-----
34
- date: 2013-09-20 00:00:00.000000000 Z
34
+ date: 2014-11-05 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: loggability
@@ -39,28 +39,28 @@ dependencies:
39
39
  requirements:
40
40
  - - ~>
41
41
  - !ruby/object:Gem::Version
42
- version: '0.4'
42
+ version: '0.11'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ~>
48
48
  - !ruby/object:Gem::Version
49
- version: '0.4'
49
+ version: '0.11'
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: hoe-mercurial
52
52
  requirement: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ~>
55
55
  - !ruby/object:Gem::Version
56
- version: 1.4.0
56
+ version: '1.4'
57
57
  type: :development
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ~>
62
62
  - !ruby/object:Gem::Version
63
- version: 1.4.0
63
+ version: '1.4'
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: hoe-manualgen
66
66
  requirement: !ruby/object:Gem::Requirement
@@ -76,61 +76,61 @@ dependencies:
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.3.0
78
78
  - !ruby/object:Gem::Dependency
79
- name: hoe-highline
79
+ name: hoe-deveiate
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - ~>
83
83
  - !ruby/object:Gem::Version
84
- version: 0.1.0
84
+ version: '0.6'
85
85
  type: :development
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ~>
90
90
  - !ruby/object:Gem::Version
91
- version: 0.1.0
91
+ version: '0.6'
92
92
  - !ruby/object:Gem::Dependency
93
- name: rdoc
93
+ name: hoe-highline
94
94
  requirement: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - ~>
97
97
  - !ruby/object:Gem::Version
98
- version: '4.0'
98
+ version: '0.2'
99
99
  type: :development
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - ~>
104
104
  - !ruby/object:Gem::Version
105
- version: '4.0'
105
+ version: '0.2'
106
106
  - !ruby/object:Gem::Dependency
107
- name: highline
107
+ name: rdoc
108
108
  requirement: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ~>
111
111
  - !ruby/object:Gem::Version
112
- version: '1.6'
112
+ version: '4.0'
113
113
  type: :development
114
114
  prerelease: false
115
115
  version_requirements: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ~>
118
118
  - !ruby/object:Gem::Version
119
- version: '1.6'
119
+ version: '4.0'
120
120
  - !ruby/object:Gem::Dependency
121
- name: hoe-deveiate
121
+ name: highline
122
122
  requirement: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ~>
125
125
  - !ruby/object:Gem::Version
126
- version: '0.3'
126
+ version: '1.6'
127
127
  type: :development
128
128
  prerelease: false
129
129
  version_requirements: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - ~>
132
132
  - !ruby/object:Gem::Version
133
- version: '0.3'
133
+ version: '1.6'
134
134
  - !ruby/object:Gem::Dependency
135
135
  name: hoe-bundler
136
136
  requirement: !ruby/object:Gem::Requirement
@@ -165,42 +165,42 @@ dependencies:
165
165
  requirements:
166
166
  - - ~>
167
167
  - !ruby/object:Gem::Version
168
- version: '0.6'
168
+ version: '0.8'
169
169
  type: :development
170
170
  prerelease: false
171
171
  version_requirements: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ~>
174
174
  - !ruby/object:Gem::Version
175
- version: '0.6'
175
+ version: '0.8'
176
176
  - !ruby/object:Gem::Dependency
177
177
  name: sinatra
178
178
  requirement: !ruby/object:Gem::Requirement
179
179
  requirements:
180
180
  - - ~>
181
181
  - !ruby/object:Gem::Version
182
- version: '1.3'
182
+ version: '1.4'
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - ~>
188
188
  - !ruby/object:Gem::Version
189
- version: '1.3'
189
+ version: '1.4'
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: tilt
192
192
  requirement: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - - ~>
195
195
  - !ruby/object:Gem::Version
196
- version: '1.4'
196
+ version: '2.0'
197
197
  type: :development
198
198
  prerelease: false
199
199
  version_requirements: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ~>
202
202
  - !ruby/object:Gem::Version
203
- version: '1.4'
203
+ version: '2.0'
204
204
  - !ruby/object:Gem::Dependency
205
205
  name: sysexits
206
206
  requirement: !ruby/object:Gem::Requirement
@@ -221,28 +221,42 @@ dependencies:
221
221
  requirements:
222
222
  - - ~>
223
223
  - !ruby/object:Gem::Version
224
- version: '1.16'
224
+ version: '2.0'
225
225
  type: :development
226
226
  prerelease: false
227
227
  version_requirements: !ruby/object:Gem::Requirement
228
228
  requirements:
229
229
  - - ~>
230
230
  - !ruby/object:Gem::Version
231
- version: '1.16'
231
+ version: '2.0'
232
+ - !ruby/object:Gem::Dependency
233
+ name: rdoc-generator-fivefish
234
+ requirement: !ruby/object:Gem::Requirement
235
+ requirements:
236
+ - - ~>
237
+ - !ruby/object:Gem::Version
238
+ version: '0'
239
+ type: :development
240
+ prerelease: false
241
+ version_requirements: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - ~>
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
232
246
  - !ruby/object:Gem::Dependency
233
247
  name: hoe
234
248
  requirement: !ruby/object:Gem::Requirement
235
249
  requirements:
236
250
  - - ~>
237
251
  - !ruby/object:Gem::Version
238
- version: '3.7'
252
+ version: '3.13'
239
253
  type: :development
240
254
  prerelease: false
241
255
  version_requirements: !ruby/object:Gem::Requirement
242
256
  requirements:
243
257
  - - ~>
244
258
  - !ruby/object:Gem::Version
245
- version: '3.7'
259
+ version: '3.13'
246
260
  description: |-
247
261
  Inversion is a templating system for Ruby. It uses the "Inversion of Control"
248
262
  principle to decouple the contents and structure of templates from the code
@@ -255,15 +269,24 @@ executables:
255
269
  - inversion
256
270
  extensions: []
257
271
  extra_rdoc_files:
272
+ - Examples.rdoc
273
+ - GettingStarted.rdoc
274
+ - Guide.rdoc
258
275
  - History.rdoc
259
276
  - Manifest.txt
260
277
  - README.rdoc
278
+ - Tags.rdoc
261
279
  files:
280
+ - .gemtest
262
281
  - ChangeLog
282
+ - Examples.rdoc
283
+ - GettingStarted.rdoc
284
+ - Guide.rdoc
263
285
  - History.rdoc
264
286
  - Manifest.txt
265
287
  - README.rdoc
266
288
  - Rakefile
289
+ - Tags.rdoc
267
290
  - bin/inversion
268
291
  - lib/inversion.rb
269
292
  - lib/inversion/exceptions.rb
@@ -286,6 +309,7 @@ files:
286
309
  - lib/inversion/template/endtag.rb
287
310
  - lib/inversion/template/escapetag.rb
288
311
  - lib/inversion/template/fortag.rb
312
+ - lib/inversion/template/fragmenttag.rb
289
313
  - lib/inversion/template/iftag.rb
290
314
  - lib/inversion/template/importtag.rb
291
315
  - lib/inversion/template/includetag.rb
@@ -303,6 +327,7 @@ files:
303
327
  - lib/inversion/tilt.rb
304
328
  - spec/data/sinatra/hello.inversion
305
329
  - spec/data/unknown-tag.tmpl
330
+ - spec/helpers.rb
306
331
  - spec/inversion/mixins_spec.rb
307
332
  - spec/inversion/monkeypatches_spec.rb
308
333
  - spec/inversion/parser_spec.rb
@@ -321,6 +346,7 @@ files:
321
346
  - spec/inversion/template/endtag_spec.rb
322
347
  - spec/inversion/template/escapetag_spec.rb
323
348
  - spec/inversion/template/fortag_spec.rb
349
+ - spec/inversion/template/fragmenttag_spec.rb
324
350
  - spec/inversion/template/iftag_spec.rb
325
351
  - spec/inversion/template/importtag_spec.rb
326
352
  - spec/inversion/template/includetag_spec.rb
@@ -338,9 +364,6 @@ files:
338
364
  - spec/inversion/template_spec.rb
339
365
  - spec/inversion/tilt_spec.rb
340
366
  - spec/inversion_spec.rb
341
- - spec/lib/constants.rb
342
- - spec/lib/helpers.rb
343
- - .gemtest
344
367
  homepage: http://deveiate.org/projects/Inversion
345
368
  licenses:
346
369
  - BSD
@@ -362,8 +385,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
362
385
  - !ruby/object:Gem::Version
363
386
  version: '0'
364
387
  requirements: []
365
- rubyforge_project: inversion
366
- rubygems_version: 2.0.5
388
+ rubyforge_project:
389
+ rubygems_version: 2.4.2
367
390
  signing_key:
368
391
  specification_version: 4
369
392
  summary: Inversion is a templating system for Ruby
metadata.gz.sig CHANGED
Binary file
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
-
4
- ### A collection of constants used in testing
5
- module Inversion::TestConstants # :nodoc:all
6
-
7
- end # module Inversion::TestConstants
8
-
9
-