inversion 0.12.3 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/ChangeLog +305 -9
- data/Examples.rdoc +134 -0
- data/GettingStarted.rdoc +44 -0
- data/Guide.rdoc +47 -0
- data/History.rdoc +15 -0
- data/Manifest.txt +7 -2
- data/README.rdoc +9 -10
- data/Rakefile +23 -10
- data/Tags.rdoc +561 -0
- data/lib/inversion.rb +2 -2
- data/lib/inversion/renderstate.rb +46 -11
- data/lib/inversion/template.rb +85 -7
- data/lib/inversion/template/attrtag.rb +1 -1
- data/lib/inversion/template/begintag.rb +8 -8
- data/lib/inversion/template/fragmenttag.rb +60 -0
- data/lib/inversion/template/rescuetag.rb +1 -1
- data/spec/{lib/helpers.rb → helpers.rb} +7 -30
- data/spec/inversion/mixins_spec.rb +55 -65
- data/spec/inversion/monkeypatches_spec.rb +2 -12
- data/spec/inversion/parser_spec.rb +34 -44
- data/spec/inversion/renderstate_spec.rb +123 -69
- data/spec/inversion/sinatra_spec.rb +6 -19
- data/spec/inversion/template/attrtag_spec.rb +56 -76
- data/spec/inversion/template/begintag_spec.rb +24 -41
- data/spec/inversion/template/calltag_spec.rb +1 -18
- data/spec/inversion/template/codetag_spec.rb +6 -24
- data/spec/inversion/template/commenttag_spec.rb +9 -27
- data/spec/inversion/template/configtag_spec.rb +5 -16
- data/spec/inversion/template/containertag_spec.rb +4 -21
- data/spec/inversion/template/defaulttag_spec.rb +6 -23
- data/spec/inversion/template/elsetag_spec.rb +9 -26
- data/spec/inversion/template/elsiftag_spec.rb +7 -24
- data/spec/inversion/template/endtag_spec.rb +6 -23
- data/spec/inversion/template/escapetag_spec.rb +10 -25
- data/spec/inversion/template/fortag_spec.rb +20 -37
- data/spec/inversion/template/fragmenttag_spec.rb +40 -0
- data/spec/inversion/template/iftag_spec.rb +23 -40
- data/spec/inversion/template/importtag_spec.rb +8 -25
- data/spec/inversion/template/includetag_spec.rb +27 -42
- data/spec/inversion/template/node_spec.rb +6 -15
- data/spec/inversion/template/pptag_spec.rb +10 -23
- data/spec/inversion/template/publishtag_spec.rb +4 -21
- data/spec/inversion/template/rescuetag_spec.rb +12 -29
- data/spec/inversion/template/subscribetag_spec.rb +8 -25
- data/spec/inversion/template/tag_spec.rb +24 -37
- data/spec/inversion/template/textnode_spec.rb +8 -24
- data/spec/inversion/template/timedeltatag_spec.rb +31 -43
- data/spec/inversion/template/unlesstag_spec.rb +7 -24
- data/spec/inversion/template/uriencodetag_spec.rb +6 -23
- data/spec/inversion/template/yieldtag_spec.rb +3 -20
- data/spec/inversion/template_spec.rb +155 -108
- data/spec/inversion/tilt_spec.rb +7 -16
- data/spec/inversion_spec.rb +7 -22
- metadata +63 -40
- metadata.gz.sig +0 -0
- data/spec/lib/constants.rb +0 -9
data/spec/inversion/tilt_spec.rb
CHANGED
@@ -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
|
-
|
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'].
|
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.
|
36
|
-
Tilt.new( 'test.tmpl' ).render( Object.new, :foo => '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.
|
43
|
-
Tilt.new( 'test.tmpl' ).render( scope, {} ).
|
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
|
data/spec/inversion_spec.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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.
|
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
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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:
|
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.
|
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.
|
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
|
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
|
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-
|
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.
|
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.
|
91
|
+
version: '0.6'
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
|
-
name:
|
93
|
+
name: hoe-highline
|
94
94
|
requirement: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '
|
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: '
|
105
|
+
version: '0.2'
|
106
106
|
- !ruby/object:Gem::Dependency
|
107
|
-
name:
|
107
|
+
name: rdoc
|
108
108
|
requirement: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - ~>
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: '
|
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: '
|
119
|
+
version: '4.0'
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
|
-
name:
|
121
|
+
name: highline
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
124
|
- - ~>
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
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: '
|
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: '
|
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: '
|
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: '
|
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.
|
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.
|
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:
|
366
|
-
rubygems_version: 2.
|
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
|