mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* sampl/test.rb: use eval instead of './miniruby -c',
in order to check a syntax error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d8a615ed3d
commit
7ee0812aee
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri May 17 16:16:19 2002 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
|
* sampl/test.rb: use eval instead of './miniruby -c',
|
||||||
|
in order to check a syntax error.
|
||||||
|
|
||||||
Thu May 16 14:46:34 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Thu May 16 14:46:34 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* eval.c (rb_thread_select): cleanup conditional compilation.
|
* eval.c (rb_thread_select): cleanup conditional compilation.
|
||||||
|
|
|
@ -1208,9 +1208,16 @@ if (dir = File.dirname(File.dirname($0))) == '.'
|
||||||
else
|
else
|
||||||
dir << "/"
|
dir << "/"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def valid_syntax?(code)
|
||||||
|
eval("BEGIN {return true}\n#{code}")
|
||||||
|
rescue Exception
|
||||||
|
ensure
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
for script in Dir["#{dir}{lib,sample,ext}/**/*.rb"]
|
for script in Dir["#{dir}{lib,sample,ext}/**/*.rb"]
|
||||||
`./miniruby -c #{script}`
|
unless valid_syntax? IO::read(script)
|
||||||
unless $?
|
|
||||||
$bad = true
|
$bad = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue