erubis 2.6.4 → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +9 -2
- data/README.txt +1 -1
- data/benchmark/bench.rb +1 -2
- data/bin/erubis +1 -2
- data/contrib/erubis +43 -68
- data/contrib/inline-require +53 -27
- data/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html +3 -3
- data/doc-api/classes/Erubis.html +1 -1
- data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +2 -2
- data/doc-api/classes/Erubis/ArrayEnhancer.html +2 -2
- data/doc-api/classes/Erubis/Basic/Converter.html +4 -4
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +2 -2
- data/doc-api/classes/Erubis/CGenerator.html +10 -10
- data/doc-api/classes/Erubis/Context.html +7 -7
- data/doc-api/classes/Erubis/Converter.html +4 -4
- data/doc-api/classes/Erubis/DeleteIndentEnhancer.html +1 -1
- data/doc-api/classes/Erubis/Engine.html +5 -5
- data/doc-api/classes/Erubis/ErboutEnhancer.html +2 -2
- data/doc-api/classes/Erubis/EscapeEnhancer.html +1 -1
- data/doc-api/classes/Erubis/Evaluator.html +3 -3
- data/doc-api/classes/Erubis/Generator.html +10 -10
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +2 -2
- data/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +25 -25
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +8 -8
- data/doc-api/classes/Erubis/Helpers/RailsHelper/TemplateConverter.html +4 -4
- data/doc-api/classes/Erubis/InterpolationEnhancer.html +5 -5
- data/doc-api/classes/Erubis/JavaGenerator.html +9 -9
- data/doc-api/classes/Erubis/JavascriptGenerator.html +10 -10
- data/doc-api/classes/Erubis/Main.html +6 -5
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +5 -5
- data/doc-api/classes/Erubis/NoTextEnhancer.html +1 -1
- data/doc-api/classes/Erubis/OptimizedEruby.html +1 -1
- data/doc-api/classes/Erubis/OptimizedGenerator.html +12 -12
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +1 -1
- data/doc-api/classes/Erubis/PI/Converter.html +3 -3
- data/doc-api/classes/Erubis/PI/Ec.html +1 -1
- data/doc-api/classes/Erubis/PI/Ejava.html +1 -1
- data/doc-api/classes/Erubis/PI/Ejavascript.html +1 -1
- data/doc-api/classes/Erubis/PI/Eperl.html +1 -1
- data/doc-api/classes/Erubis/PI/Ephp.html +1 -1
- data/doc-api/classes/Erubis/PI/Eruby.html +1 -1
- data/doc-api/classes/Erubis/PI/Escheme.html +1 -1
- data/doc-api/classes/Erubis/PI/TinyEruby.html +4 -4
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +1 -1
- data/doc-api/classes/Erubis/PerlGenerator.html +9 -9
- data/doc-api/classes/Erubis/PhpGenerator.html +9 -9
- data/doc-api/classes/Erubis/PreprocessingEruby.html +2 -2
- data/doc-api/classes/Erubis/PreprocessingHelper.html +3 -3
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +3 -3
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +5 -5
- data/doc-api/classes/Erubis/RubyEvaluator.html +3 -3
- data/doc-api/classes/Erubis/RubyGenerator.html +8 -8
- data/doc-api/classes/Erubis/SchemeGenerator.html +10 -10
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +1 -1
- data/doc-api/classes/Erubis/StdoutEnhancer.html +2 -2
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +2 -2
- data/doc-api/classes/Erubis/TinyEruby.html +7 -8
- data/doc-api/classes/Erubis/XmlHelper.html +3 -3
- data/doc-api/created.rid +1 -1
- data/doc-api/files/README_txt.html +2 -2
- data/doc-api/files/erubis/context_rb.html +2 -2
- data/doc-api/files/erubis/converter_rb.html +2 -2
- data/doc-api/files/erubis/engine/ec_rb.html +2 -2
- data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
- data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
- data/doc-api/files/erubis/engine/enhanced_rb.html +2 -2
- data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
- data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
- data/doc-api/files/erubis/engine/eruby_rb.html +2 -2
- data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
- data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
- data/doc-api/files/erubis/engine_rb.html +2 -2
- data/doc-api/files/erubis/enhancer_rb.html +2 -2
- data/doc-api/files/erubis/error_rb.html +2 -2
- data/doc-api/files/erubis/evaluator_rb.html +2 -2
- data/doc-api/files/erubis/generator_rb.html +2 -2
- data/doc-api/files/erubis/helper_rb.html +2 -2
- data/doc-api/files/erubis/helpers/rails_form_helper_rb.html +2 -2
- data/doc-api/files/erubis/helpers/rails_helper_rb.html +2 -2
- data/doc-api/files/erubis/local-setting_rb.html +2 -2
- data/doc-api/files/erubis/main_rb.html +2 -2
- data/doc-api/files/erubis/preprocessing_rb.html +2 -2
- data/doc-api/files/erubis/tiny_rb.html +2 -2
- data/doc-api/files/erubis_rb.html +2 -2
- data/doc/users-guide.html +6 -6
- data/lib/erubis.rb +2 -3
- data/lib/erubis/context.rb +1 -2
- data/lib/erubis/converter.rb +1 -2
- data/lib/erubis/engine.rb +1 -2
- data/lib/erubis/engine/ec.rb +1 -2
- data/lib/erubis/engine/ejava.rb +1 -2
- data/lib/erubis/engine/ejavascript.rb +1 -2
- data/lib/erubis/engine/enhanced.rb +1 -2
- data/lib/erubis/engine/eperl.rb +1 -2
- data/lib/erubis/engine/ephp.rb +1 -2
- data/lib/erubis/engine/eruby.rb +1 -2
- data/lib/erubis/engine/escheme.rb +1 -2
- data/lib/erubis/engine/optimized.rb +1 -2
- data/lib/erubis/enhancer.rb +1 -2
- data/lib/erubis/error.rb +1 -2
- data/lib/erubis/evaluator.rb +1 -2
- data/lib/erubis/generator.rb +1 -2
- data/lib/erubis/helper.rb +1 -2
- data/lib/erubis/helpers/rails_form_helper.rb +1 -2
- data/lib/erubis/helpers/rails_helper.rb +1 -2
- data/lib/erubis/local-setting.rb +1 -2
- data/lib/erubis/main.rb +18 -21
- data/lib/erubis/preprocessing.rb +1 -2
- data/lib/erubis/tiny.rb +4 -6
- data/test/assert-text-equal.rb +1 -2
- data/test/test-engines.rb +1 -2
- data/test/test-enhancers.rb +1 -2
- data/test/test-erubis.rb +1 -2
- data/test/test-main.rb +36 -16
- data/test/test-users-guide.rb +1 -2
- data/test/test.rb +1 -2
- data/test/testutil.rb +3 -8
- metadata +2 -2
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Tue Jul 14 09:47:22 +0900 2009</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
<div id="description">
|
72
72
|
<p>
|
73
|
-
$
|
73
|
+
$Release: 2.6.5 $ copyright(c) 2006-2009 kuwata-lab.com all rights reserved.
|
74
74
|
</p>
|
75
75
|
|
76
76
|
</div>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Tue Jul 14 09:47:22 +0900 2009</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
<div id="description">
|
72
72
|
<p>
|
73
|
-
$
|
73
|
+
$Release: 2.6.5 $ copyright(c) 2006-2009 kuwata-lab.com all rights reserved.
|
74
74
|
</p>
|
75
75
|
|
76
76
|
</div>
|
data/doc/users-guide.html
CHANGED
@@ -14,10 +14,10 @@
|
|
14
14
|
|
15
15
|
<div align="left"><h1>Erubis Users' Guide</h1></div>
|
16
16
|
<div align="left">
|
17
|
-
last update: $Date
|
17
|
+
last update: $Date$<br>
|
18
18
|
</div>
|
19
19
|
|
20
|
-
<p>release: 2.6.
|
20
|
+
<p>release: 2.6.5
|
21
21
|
</p>
|
22
22
|
<a name="preface"></a>
|
23
23
|
<h2 class="section1">Preface</h2>
|
@@ -2986,8 +2986,8 @@ example of using NoCodeEnhancer with PHP file</div>
|
|
2986
2986
|
<p>Thanks Andrew R Jackson, he developed 'erubis-run.rb' which enables you to use Erubis with mod_ruby.
|
2987
2987
|
</p>
|
2988
2988
|
<ol type="1">
|
2989
|
-
<li>Copy 'erubis-2.6.
|
2990
|
-
<pre class="terminal">$ cd erubis-2.6.
|
2989
|
+
<li>Copy 'erubis-2.6.5/contrib/erubis-run.rb' to the 'RUBYLIBDIR/apache' directory (for example '/usr/local/lib/ruby/1.8/apache') which contains 'ruby-run.rb', 'eruby-run.rb', and so on.
|
2990
|
+
<pre class="terminal">$ cd erubis-2.6.5/
|
2991
2991
|
$ sudo copy contrib/erubis-run.rb /usr/local/lib/ruby/1.8/apache/
|
2992
2992
|
</pre>
|
2993
2993
|
</li>
|
@@ -3063,12 +3063,12 @@ p obj.render('world') #=> "hello world"
|
|
3063
3063
|
|
3064
3064
|
<a name="topics-benchmark"></a>
|
3065
3065
|
<h3 class="section2">Benchmark</h3>
|
3066
|
-
<p>A benchmark script is included in Erubis package at 'erubis-2.6.
|
3066
|
+
<p>A benchmark script is included in Erubis package at 'erubis-2.6.5/benchark/' directory.
|
3067
3067
|
Here is an example result of benchmark.
|
3068
3068
|
</p>
|
3069
3069
|
<div class="terminal_caption">
|
3070
3070
|
MacOS X 10.4 Tiger, Intel CoreDuo 1.83GHz, Ruby1.8.6, eruby1.0.5, gcc4.0.1</div>
|
3071
|
-
<pre class="terminal">$ cd erubis-2.6.
|
3071
|
+
<pre class="terminal">$ cd erubis-2.6.5/benchmark/
|
3072
3072
|
$ ruby bench.rb -n 10000 -m execute
|
3073
3073
|
*** ntimes=10000, testmode=execute
|
3074
3074
|
user system total real
|
data/lib/erubis.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
##
|
2
|
-
## $
|
3
|
-
## $Release: 2.6.4 $
|
2
|
+
## $Release: 2.6.5 $
|
4
3
|
## copyright(c) 2006-2009 kuwata-lab.com all rights reserved.
|
5
4
|
##
|
6
5
|
|
@@ -48,7 +47,7 @@
|
|
48
47
|
|
49
48
|
|
50
49
|
module Erubis
|
51
|
-
VERSION = ('$Release: 2.6.
|
50
|
+
VERSION = ('$Release: 2.6.5 $' =~ /([.\d]+)/) && $1
|
52
51
|
end
|
53
52
|
|
54
53
|
require 'erubis/engine'
|
data/lib/erubis/context.rb
CHANGED
data/lib/erubis/converter.rb
CHANGED
data/lib/erubis/engine.rb
CHANGED
data/lib/erubis/engine/ec.rb
CHANGED
data/lib/erubis/engine/ejava.rb
CHANGED
data/lib/erubis/engine/eperl.rb
CHANGED
data/lib/erubis/engine/ephp.rb
CHANGED
data/lib/erubis/engine/eruby.rb
CHANGED
data/lib/erubis/enhancer.rb
CHANGED
data/lib/erubis/error.rb
CHANGED
data/lib/erubis/evaluator.rb
CHANGED
data/lib/erubis/generator.rb
CHANGED
data/lib/erubis/helper.rb
CHANGED
data/lib/erubis/local-setting.rb
CHANGED
data/lib/erubis/main.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
###
|
2
|
-
### $
|
3
|
-
### $Release: 2.6.4 $
|
2
|
+
### $Release: 2.6.5 $
|
4
3
|
### copyright(c) 2006-2009 kuwata-lab.com all rights reserved.
|
5
4
|
###
|
6
5
|
|
@@ -90,7 +89,7 @@ module Erubis
|
|
90
89
|
filenames = argv
|
91
90
|
options['h'] = true if properties[:help]
|
92
91
|
opts = Object.new
|
93
|
-
arr = @option_names.collect {
|
92
|
+
arr = @option_names.collect {|ch, name| "def #{name}; @#{name}; end\n" }
|
94
93
|
opts.instance_eval arr.join
|
95
94
|
options.each do |ch, val|
|
96
95
|
name = @option_names[ch]
|
@@ -166,7 +165,8 @@ module Erubis
|
|
166
165
|
msg = "Syntax OK\n"
|
167
166
|
if filenames && !filenames.empty?
|
168
167
|
filenames.each do |filename|
|
169
|
-
|
168
|
+
File.file?(filename) or
|
169
|
+
raise CommandOptionError.new("#{filename}: file not found.")
|
170
170
|
engine.filename = filename
|
171
171
|
engine.convert!(File.read(filename))
|
172
172
|
val = do_action(action, engine, context, filename, opts)
|
@@ -284,14 +284,13 @@ module Erubis
|
|
284
284
|
end
|
285
285
|
|
286
286
|
def show_enhancers
|
287
|
+
dict = {}
|
288
|
+
ObjectSpace.each_object(Module) do |mod|
|
289
|
+
dict[$1] = mod if mod.name =~ /\AErubis::(.*)Enhancer\z/
|
290
|
+
end
|
287
291
|
s = "enhancers:\n"
|
288
|
-
|
289
|
-
|
290
|
-
list.sort_by { |m| m.name.to_s }.each do |m|
|
291
|
-
next unless m.name =~ /\AErubis::(.*)Enhancer\z/
|
292
|
-
name = $1
|
293
|
-
desc = m.desc
|
294
|
-
s << (" %-13s : %s\n" % [name, desc])
|
292
|
+
dict.sort_by {|name, mod| name }.each do |name, mod|
|
293
|
+
s << (" %-13s : %s\n" % [name, mod.desc])
|
295
294
|
end
|
296
295
|
return s
|
297
296
|
end
|
@@ -308,10 +307,9 @@ module Erubis
|
|
308
307
|
optstr = optstr[1, optstr.length-1]
|
309
308
|
#
|
310
309
|
if optstr[0] == ?- # context
|
311
|
-
|
310
|
+
optstr =~ /\A\-([-\w]+)(?:=(.*))?/ or
|
312
311
|
raise CommandOptionError.new("-#{optstr}: invalid context value.")
|
313
|
-
|
314
|
-
name = $1; value = $2
|
312
|
+
name, value = $1, $2
|
315
313
|
name = name.gsub(/-/, '_').intern
|
316
314
|
#value = value.nil? ? true : YAML.load(value) # error, why?
|
317
315
|
value = value.nil? ? true : YAML.load("---\n#{value}\n")
|
@@ -320,15 +318,12 @@ module Erubis
|
|
320
318
|
else # options
|
321
319
|
while optstr && !optstr.empty?
|
322
320
|
optchar = optstr[0].chr
|
323
|
-
optstr[
|
321
|
+
optstr = optstr[1..-1]
|
324
322
|
if arg_none.include?(optchar)
|
325
323
|
options[optchar] = true
|
326
324
|
elsif arg_required.include?(optchar)
|
327
|
-
arg = optstr.empty? ? argv.shift : optstr
|
328
|
-
|
329
|
-
mesg = "-#{optchar}: #{@option_names[optchar]} required."
|
330
|
-
raise CommandOptionError.new(mesg)
|
331
|
-
end
|
325
|
+
arg = optstr.empty? ? argv.shift : optstr or
|
326
|
+
raise CommandOptionError.new("-#{optchar}: #{@option_names[optchar]} required.")
|
332
327
|
options[optchar] = arg
|
333
328
|
optstr = nil
|
334
329
|
elsif arg_optional.include?(optchar)
|
@@ -473,7 +468,9 @@ module Erubis
|
|
473
468
|
|
474
469
|
def check_syntax(filename, src)
|
475
470
|
require 'open3'
|
476
|
-
command = (ENV['_'] || 'ruby') + ' -wc' # ENV['_'] stores command name
|
471
|
+
#command = (ENV['_'] || 'ruby') + ' -wc' # ENV['_'] stores command name
|
472
|
+
bin = ENV['_'] && File.basename(ENV['_']) =~ /^ruby/ ? ENV['_'] : 'ruby'
|
473
|
+
command = bin + ' -wc'
|
477
474
|
stdin, stdout, stderr = Open3.popen3(command)
|
478
475
|
stdin.write(src)
|
479
476
|
stdin.close
|
data/lib/erubis/preprocessing.rb
CHANGED
data/lib/erubis/tiny.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
##
|
2
|
-
## $
|
3
|
-
## $Release: 2.6.4 $
|
2
|
+
## $Release: 2.6.5 $
|
4
3
|
## copyright(c) 2006-2009 kuwata-lab.com all rights reserved.
|
5
4
|
##
|
6
5
|
|
@@ -28,10 +27,9 @@ module Erubis
|
|
28
27
|
src = "_buf = '';" # preamble
|
29
28
|
pos = 0
|
30
29
|
input.scan(EMBEDDED_PATTERN) do |indicator, code|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
pos = match.end(0)
|
30
|
+
m = Regexp.last_match
|
31
|
+
text = input[pos...m.begin(0)]
|
32
|
+
pos = m.end(0)
|
35
33
|
#src << " _buf << '" << escape_text(text) << "';"
|
36
34
|
text.gsub!(/['\\]/, '\\\\\&')
|
37
35
|
src << " _buf << '" << text << "';" unless text.empty?
|
data/test/assert-text-equal.rb
CHANGED
data/test/test-engines.rb
CHANGED
data/test/test-enhancers.rb
CHANGED
data/test/test-erubis.rb
CHANGED
data/test/test-main.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##
|
2
|
-
## $Rev
|
3
|
-
## $Release: 2.6.
|
4
|
-
## $Date
|
2
|
+
## $Rev$
|
3
|
+
## $Release: 2.6.5 $
|
4
|
+
## $Date$
|
5
5
|
##
|
6
6
|
|
7
7
|
require "#{File.dirname(__FILE__)}/test.rb"
|
@@ -141,16 +141,12 @@ END
|
|
141
141
|
END
|
142
142
|
|
143
143
|
def _test()
|
144
|
-
if $target
|
145
|
-
name = (caller()[0] =~ /in `test_(.*?)'/) && $1
|
146
|
-
return unless name == $target
|
147
|
-
end
|
148
144
|
if @filename.nil?
|
149
145
|
method = (caller[0] =~ /in `(.*)'/) && $1 #'
|
150
146
|
method =~ /block in (.*)/ and method = $1 # for Ruby 1.9
|
151
147
|
@filename = "tmp.#{method}"
|
152
148
|
end
|
153
|
-
File.open(@filename, 'w') {
|
149
|
+
File.open(@filename, 'w') {|f| f.write(@input) } if @filename
|
154
150
|
begin
|
155
151
|
argv = @options.is_a?(Array) ? @options.dup : @options.split
|
156
152
|
argv << @filename if @filename
|
@@ -179,7 +175,7 @@ END
|
|
179
175
|
|
180
176
|
def test_version # -v
|
181
177
|
@options = '-v'
|
182
|
-
@expected = (("$Release: 2.6.
|
178
|
+
@expected = (("$Release: 2.6.5 $" =~ /[.\d]+/) && $&) + "\n"
|
183
179
|
@filename = false
|
184
180
|
_test()
|
185
181
|
end
|
@@ -201,11 +197,35 @@ END
|
|
201
197
|
end
|
202
198
|
|
203
199
|
|
200
|
+
def _with_dummy_file
|
201
|
+
bindir = File.join(File.dirname(File.dirname(__FILE__)), 'bin')
|
202
|
+
env_path = ENV['PATH']
|
203
|
+
env__ = ENV['_']
|
204
|
+
begin
|
205
|
+
ENV['PATH'] = bindir + File::PATH_SEPARATOR + ENV['PATH']
|
206
|
+
ENV['_'] = 'erubis'
|
207
|
+
Tempfile.open(self.name.gsub(/[^\w]/,'_')) do |f|
|
208
|
+
f.write(INPUT)
|
209
|
+
f.flush
|
210
|
+
yield(f.path)
|
211
|
+
end
|
212
|
+
ensure
|
213
|
+
ENV['PATH'] = env_path
|
214
|
+
ENV['_'] = env__ if env__
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
|
204
219
|
def test_syntax1 # -z (syntax ok)
|
205
220
|
@input = INPUT
|
206
221
|
@expected = "Syntax OK\n"
|
207
222
|
@options = '-z'
|
208
223
|
_test()
|
224
|
+
#
|
225
|
+
_with_dummy_file do |filepath|
|
226
|
+
actual = `erubis #{@options} #{filepath}`
|
227
|
+
assert_equal @expected, actual
|
228
|
+
end
|
209
229
|
end
|
210
230
|
|
211
231
|
|
@@ -266,7 +286,7 @@ END
|
|
266
286
|
#
|
267
287
|
begin
|
268
288
|
(0...max).each do |i|
|
269
|
-
File.open(filenames[i], 'w') {
|
289
|
+
File.open(filenames[i], 'w') {|f| f.write(inputs[i]) }
|
270
290
|
end
|
271
291
|
@input = '<ok/>'
|
272
292
|
@expected = ''
|
@@ -365,7 +385,7 @@ END
|
|
365
385
|
user: Hello
|
366
386
|
password: world
|
367
387
|
END
|
368
|
-
File.open(datafile, 'w') {
|
388
|
+
File.open(datafile, 'w') {|f| f.write(str) }
|
369
389
|
begin
|
370
390
|
_test()
|
371
391
|
ensure
|
@@ -384,7 +404,7 @@ END
|
|
384
404
|
@user = 'Hello'
|
385
405
|
@password = 'world'
|
386
406
|
END
|
387
|
-
File.open(datafile, 'w') {
|
407
|
+
File.open(datafile, 'w') {|f| f.write(str) }
|
388
408
|
begin
|
389
409
|
_test()
|
390
410
|
ensure
|
@@ -403,7 +423,7 @@ END
|
|
403
423
|
user: Hello
|
404
424
|
password: world
|
405
425
|
END
|
406
|
-
File.open(yamlfile, 'w') {
|
426
|
+
File.open(yamlfile, 'w') {|f| f.write(yaml) }
|
407
427
|
begin
|
408
428
|
_test()
|
409
429
|
ensure
|
@@ -425,11 +445,11 @@ END
|
|
425
445
|
- bbb
|
426
446
|
- ccc
|
427
447
|
END
|
428
|
-
File.open(yamlfile, 'w') {
|
448
|
+
File.open(yamlfile, 'w') {|f| f.write(yaml) }
|
429
449
|
assert_raise(ArgumentError) do
|
430
450
|
_test()
|
431
451
|
end
|
432
|
-
File.open(yamlfile, 'w') {
|
452
|
+
File.open(yamlfile, 'w') {|f| f.write(yaml.gsub(/\t/, ' '*8)) }
|
433
453
|
_test()
|
434
454
|
ensure
|
435
455
|
File.unlink(yamlfile) if test(?f, yamlfile)
|
@@ -495,7 +515,7 @@ list:
|
|
495
515
|
- bbb
|
496
516
|
- ccc
|
497
517
|
END
|
498
|
-
File.open(yamlfile, 'w') {
|
518
|
+
File.open(yamlfile, 'w') {|f| f.write(yaml) }
|
499
519
|
begin
|
500
520
|
_test()
|
501
521
|
ensure
|