inversion 0.15.0 → 0.16.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 +0 -0
- data.tar.gz.sig +0 -0
- data/Guide.rdoc +1 -1
- data/History.rdoc +6 -0
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/lib/inversion.rb +3 -3
- data/lib/inversion/template.rb +5 -3
- data/spec/helpers.rb +2 -0
- data/spec/inversion/template/configtag_spec.rb +2 -11
- data/spec/inversion/template/includetag_spec.rb +0 -1
- data/spec/inversion/template_spec.rb +21 -2
- metadata +40 -40
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4433eb48f907f0b5861914eb3ec073bee86431b
|
4
|
+
data.tar.gz: 99143eca9a86f27e54488b9cbb5f8aa9d2cf9072
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4a08815c33455449aaf698a30012673674f912f6c05a57f6ac91b17d91a81b7816f0402074a0fe3ba4633f1dc19953f601ebe3830866106555afa2695d72cdc
|
7
|
+
data.tar.gz: 0cfbcfeab6c68c663c9e58c3832fe50a6ab803148d1c51dc7ba1cbcf821b01d3000164a1944086bf5f8ee241ea17db0e31209a7a1d12d8c8727e89e5b1ec27b5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Guide.rdoc
CHANGED
@@ -21,7 +21,7 @@ Finally, there are a number of {Annotated Examples}[rdoc-ref:Examples] that illu
|
|
21
21
|
|
22
22
|
== License
|
23
23
|
|
24
|
-
Copyright © 2011-
|
24
|
+
Copyright © 2011-2015, Michael Granger, Mahlon E. Smith
|
25
25
|
All rights reserved.
|
26
26
|
|
27
27
|
Redistribution and use in source and binary forms, with or without modification, are
|
data/History.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== v0.16.0 [2015-01-14] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
Add support for loading templates from an alternate path
|
4
|
+
via :template_paths option to Inversion::Template.load.
|
5
|
+
|
6
|
+
|
1
7
|
== v0.15.0 [2014-11-24] Michael Granger <ged@FaerieMUD.org>
|
2
8
|
|
3
9
|
Add a mechanism to allow tags to extend the template.
|
data/README.rdoc
CHANGED
@@ -119,7 +119,7 @@ and generate the API documentation.
|
|
119
119
|
|
120
120
|
== License
|
121
121
|
|
122
|
-
Copyright © 2011-
|
122
|
+
Copyright © 2011-2015, Michael Granger and Mahlon E. Smith
|
123
123
|
All rights reserved.
|
124
124
|
|
125
125
|
Redistribution and use in source and binary forms, with or without
|
data/Rakefile
CHANGED
@@ -40,7 +40,7 @@ hoespec = Hoe.spec 'inversion' do
|
|
40
40
|
self.dependency 'trollop', '~> 2.0', :development
|
41
41
|
self.dependency 'rdoc-generator-fivefish', '~> 0', :development
|
42
42
|
|
43
|
-
self.require_ruby_version( '>=
|
43
|
+
self.require_ruby_version( '>=2.0.0' )
|
44
44
|
self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
|
45
45
|
self.check_history_on_release = true if self.respond_to?( :check_history_on_release= )
|
46
46
|
self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
|
data/lib/inversion.rb
CHANGED
@@ -23,13 +23,13 @@ module Inversion
|
|
23
23
|
log_as :inversion
|
24
24
|
|
25
25
|
|
26
|
-
warn ">>> Inversion requires Ruby
|
26
|
+
warn ">>> Inversion requires Ruby 2.0.0 or later. <<<" if RUBY_VERSION < '2.0.0'
|
27
27
|
|
28
28
|
# Library version constant
|
29
|
-
VERSION = '0.
|
29
|
+
VERSION = '0.16.0'
|
30
30
|
|
31
31
|
# Version-control revision constant
|
32
|
-
REVISION = %q$Revision:
|
32
|
+
REVISION = %q$Revision: 83bef41f95a3 $
|
33
33
|
|
34
34
|
|
35
35
|
### Get the Inversion version.
|
data/lib/inversion/template.rb
CHANGED
@@ -169,7 +169,9 @@ class Inversion::Template
|
|
169
169
|
|
170
170
|
tmpl = nil
|
171
171
|
path = Pathname( path )
|
172
|
-
template_paths
|
172
|
+
opts[:template_paths] ||= self.template_paths
|
173
|
+
search_path = opts[:template_paths] + [ Dir.pwd ]
|
174
|
+
self.log.debug "Searching template paths: %p" % [ search_path ]
|
173
175
|
|
174
176
|
# Unrestricted template location.
|
175
177
|
if path.absolute?
|
@@ -178,12 +180,12 @@ class Inversion::Template
|
|
178
180
|
# Template files searched under paths specified in 'template_paths', then
|
179
181
|
# the current working directory. First match wins.
|
180
182
|
else
|
181
|
-
tmpl =
|
183
|
+
tmpl = search_path.collect {|dir| Pathname(dir) + path }.find do |fullpath|
|
182
184
|
fullpath.exist?
|
183
185
|
end
|
184
186
|
|
185
187
|
raise RuntimeError, "Unable to find template %p within configured paths %p" %
|
186
|
-
[ path.to_s,
|
188
|
+
[ path.to_s, search_path ] if tmpl.nil?
|
187
189
|
end
|
188
190
|
|
189
191
|
# We trust files read from disk
|
data/spec/helpers.rb
CHANGED
@@ -7,15 +7,6 @@ require 'inversion/template/configtag'
|
|
7
7
|
|
8
8
|
describe Inversion::Template::ConfigTag do
|
9
9
|
|
10
|
-
before( :all ) do
|
11
|
-
Inversion::Template.template_paths << 'spec/data'
|
12
|
-
end
|
13
|
-
|
14
|
-
after( :all ) do
|
15
|
-
Inversion::Template.template_paths.delete( 'spec/data' )
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
10
|
# <?config comment_start: /* ?>
|
20
11
|
# <?config comment_end: */ ?>
|
21
12
|
it "can contain a single configuration setting" do
|
@@ -97,7 +88,7 @@ describe Inversion::Template::ConfigTag do
|
|
97
88
|
<?include unknown-tag.tmpl ?>
|
98
89
|
TEMPLATE
|
99
90
|
expect {
|
100
|
-
Inversion::Template.new( source )
|
91
|
+
Inversion::Template.new( source, template_paths: %w[spec/data] )
|
101
92
|
}.to raise_error( Inversion::ParseError, /unknown tag "unknown"/i )
|
102
93
|
end
|
103
94
|
|
@@ -107,7 +98,7 @@ describe Inversion::Template::ConfigTag do
|
|
107
98
|
<?attr subtemplate ?>
|
108
99
|
TEMPLATE
|
109
100
|
tmpl = Inversion::Template.new( source )
|
110
|
-
tmpl.subtemplate = Inversion::Template.load( 'unknown-tag.tmpl' )
|
101
|
+
tmpl.subtemplate = Inversion::Template.load( 'unknown-tag.tmpl', template_paths: %w[spec/data] )
|
111
102
|
|
112
103
|
expect( tmpl.render ).to match( /commented out 1 nodes on line 3: some stuff/i )
|
113
104
|
end
|
@@ -9,7 +9,6 @@ require 'inversion/template/includetag'
|
|
9
9
|
|
10
10
|
describe Inversion::Template::IncludeTag do
|
11
11
|
|
12
|
-
|
13
12
|
it "renders the IncludeTag as an empty string" do
|
14
13
|
included_path = Pathname.pwd + 'included.tmpl'
|
15
14
|
expect( FileTest ).to receive( :exist? ).with( included_path.to_s ).and_return( true )
|
@@ -9,6 +9,16 @@ require 'inversion/template'
|
|
9
9
|
|
10
10
|
describe Inversion::Template do
|
11
11
|
|
12
|
+
before( :all ) do
|
13
|
+
@default_template_path = Inversion::Template.template_paths
|
14
|
+
Inversion::Template::Tag.load_all
|
15
|
+
end
|
16
|
+
|
17
|
+
after( :all ) do
|
18
|
+
Inversion::Template.template_paths = @default_template_path
|
19
|
+
end
|
20
|
+
|
21
|
+
|
12
22
|
context "created from a simple string" do
|
13
23
|
|
14
24
|
let( :template ) { described_class.new("a template") }
|
@@ -278,6 +288,15 @@ describe Inversion::Template do
|
|
278
288
|
expect( IO ).to receive( :read ).with( tmplpath.to_s ).and_return( 'file contents' )
|
279
289
|
expect( described_class.load( 'hooowat.tmpl' ).source ).to eq( 'file contents' )
|
280
290
|
end
|
291
|
+
|
292
|
+
it "instances can be loaded from a path provided via options" do
|
293
|
+
expect( FileTest ).to receive( :exist? ).with( '/tmp/hooowat' ).and_return( true )
|
294
|
+
expect( IO ).to receive( :read ).with( '/tmp/hooowat' ).and_return( 'file contents' )
|
295
|
+
expect(
|
296
|
+
described_class.load( 'hooowat', template_paths: %w[/tmp] ).source
|
297
|
+
).to eq( 'file contents' )
|
298
|
+
end
|
299
|
+
|
281
300
|
end
|
282
301
|
|
283
302
|
|
@@ -397,8 +416,8 @@ describe Inversion::Template do
|
|
397
416
|
|
398
417
|
described_class.configure( config.templates )
|
399
418
|
|
400
|
-
expect( described_class.config[:ignore_unknown_tags] ).to
|
401
|
-
expect( described_class.config[:debugging_comments] ).to
|
419
|
+
expect( described_class.config[:ignore_unknown_tags] ).to be_falsey()
|
420
|
+
expect( described_class.config[:debugging_comments] ).to be_truthy()
|
402
421
|
expect( described_class.config[:comment_start] ).to eq( '#' )
|
403
422
|
expect( described_class.config[:comment_end] ).to eq( '' )
|
404
423
|
|
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.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -31,230 +31,230 @@ cert_chain:
|
|
31
31
|
c7ZKPJcWBv0sm81+FCZXNACn2f9jfF8OQinxVs0O052KbGuEQaaiGIYeuuwQE2q6
|
32
32
|
ggcrPfcYeTwWlfZPu2LrBg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: loggability
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ~>
|
41
41
|
- !ruby/object:Gem::Version
|
42
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
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
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
63
|
version: '1.4'
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: hoe-manualgen
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ~>
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: 0.3.0
|
71
71
|
type: :development
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: 0.3.0
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: hoe-deveiate
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ~>
|
83
83
|
- !ruby/object:Gem::Version
|
84
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
91
|
version: '0.6'
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: hoe-highline
|
94
94
|
requirement: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ~>
|
97
97
|
- !ruby/object:Gem::Version
|
98
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
105
|
version: '0.2'
|
106
106
|
- !ruby/object:Gem::Dependency
|
107
107
|
name: rdoc
|
108
108
|
requirement: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - ~>
|
111
111
|
- !ruby/object:Gem::Version
|
112
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
119
|
version: '4.0'
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
121
|
name: highline
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- -
|
124
|
+
- - ~>
|
125
125
|
- !ruby/object:Gem::Version
|
126
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
133
|
version: '1.6'
|
134
134
|
- !ruby/object:Gem::Dependency
|
135
135
|
name: hoe-bundler
|
136
136
|
requirement: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- -
|
138
|
+
- - ~>
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '1.2'
|
141
141
|
type: :development
|
142
142
|
prerelease: false
|
143
143
|
version_requirements: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- -
|
145
|
+
- - ~>
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '1.2'
|
148
148
|
- !ruby/object:Gem::Dependency
|
149
149
|
name: rack-test
|
150
150
|
requirement: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
|
-
- -
|
152
|
+
- - ~>
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0.6'
|
155
155
|
type: :development
|
156
156
|
prerelease: false
|
157
157
|
version_requirements: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
|
-
- -
|
159
|
+
- - ~>
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0.6'
|
162
162
|
- !ruby/object:Gem::Dependency
|
163
163
|
name: simplecov
|
164
164
|
requirement: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
|
-
- -
|
166
|
+
- - ~>
|
167
167
|
- !ruby/object:Gem::Version
|
168
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
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
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
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
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
203
|
version: '2.0'
|
204
204
|
- !ruby/object:Gem::Dependency
|
205
205
|
name: sysexits
|
206
206
|
requirement: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
|
-
- -
|
208
|
+
- - ~>
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '1.0'
|
211
211
|
type: :development
|
212
212
|
prerelease: false
|
213
213
|
version_requirements: !ruby/object:Gem::Requirement
|
214
214
|
requirements:
|
215
|
-
- -
|
215
|
+
- - ~>
|
216
216
|
- !ruby/object:Gem::Version
|
217
217
|
version: '1.0'
|
218
218
|
- !ruby/object:Gem::Dependency
|
219
219
|
name: trollop
|
220
220
|
requirement: !ruby/object:Gem::Requirement
|
221
221
|
requirements:
|
222
|
-
- -
|
222
|
+
- - ~>
|
223
223
|
- !ruby/object:Gem::Version
|
224
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
231
|
version: '2.0'
|
232
232
|
- !ruby/object:Gem::Dependency
|
233
233
|
name: rdoc-generator-fivefish
|
234
234
|
requirement: !ruby/object:Gem::Requirement
|
235
235
|
requirements:
|
236
|
-
- -
|
236
|
+
- - ~>
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0'
|
239
239
|
type: :development
|
240
240
|
prerelease: false
|
241
241
|
version_requirements: !ruby/object:Gem::Requirement
|
242
242
|
requirements:
|
243
|
-
- -
|
243
|
+
- - ~>
|
244
244
|
- !ruby/object:Gem::Version
|
245
245
|
version: '0'
|
246
246
|
- !ruby/object:Gem::Dependency
|
247
247
|
name: hoe
|
248
248
|
requirement: !ruby/object:Gem::Requirement
|
249
249
|
requirements:
|
250
|
-
- -
|
250
|
+
- - ~>
|
251
251
|
- !ruby/object:Gem::Version
|
252
252
|
version: '3.13'
|
253
253
|
type: :development
|
254
254
|
prerelease: false
|
255
255
|
version_requirements: !ruby/object:Gem::Requirement
|
256
256
|
requirements:
|
257
|
-
- -
|
257
|
+
- - ~>
|
258
258
|
- !ruby/object:Gem::Version
|
259
259
|
version: '3.13'
|
260
260
|
description: |-
|
@@ -277,7 +277,7 @@ extra_rdoc_files:
|
|
277
277
|
- README.rdoc
|
278
278
|
- Tags.rdoc
|
279
279
|
files:
|
280
|
-
-
|
280
|
+
- .gemtest
|
281
281
|
- ChangeLog
|
282
282
|
- Examples.rdoc
|
283
283
|
- GettingStarted.rdoc
|
@@ -370,23 +370,23 @@ licenses:
|
|
370
370
|
metadata: {}
|
371
371
|
post_install_message:
|
372
372
|
rdoc_options:
|
373
|
-
-
|
373
|
+
- --main
|
374
374
|
- README.rdoc
|
375
375
|
require_paths:
|
376
376
|
- lib
|
377
377
|
required_ruby_version: !ruby/object:Gem::Requirement
|
378
378
|
requirements:
|
379
|
-
- -
|
379
|
+
- - '>='
|
380
380
|
- !ruby/object:Gem::Version
|
381
|
-
version:
|
381
|
+
version: 2.0.0
|
382
382
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
383
383
|
requirements:
|
384
|
-
- -
|
384
|
+
- - '>='
|
385
385
|
- !ruby/object:Gem::Version
|
386
386
|
version: '0'
|
387
387
|
requirements: []
|
388
388
|
rubyforge_project:
|
389
|
-
rubygems_version: 2.4.
|
389
|
+
rubygems_version: 2.4.5
|
390
390
|
signing_key:
|
391
391
|
specification_version: 4
|
392
392
|
summary: Inversion is a templating system for Ruby
|
metadata.gz.sig
CHANGED
Binary file
|