summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/extmk.rb.in4
-rw-r--r--lib/singleton.rb4
-rw-r--r--sample/test.rb7
3 files changed, 8 insertions, 7 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 34c30638fc..8690e7a714 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -412,7 +412,7 @@ def create_makefile(target)
$srcdir = File.join($top_srcdir,"ext",$mdir)
mfile = open("Makefile", "w")
mfile.binmode if /mingw/ =~ RUBY_PLATFORM
- mfile.printf "\
+ mfile.printf <<EOL, if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
SHELL = /bin/sh
#### Start of system configuration section. ####
@@ -436,7 +436,7 @@ else
"LDSHARED = @LDSHARED@ #{defflag}\n"
end
}
-", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
+EOL
mfile.puts "LIBPATH = #{libpath}" if libpath
mfile.puts ".SUFFIXES: .@OBJEXT@" unless "@OBJEXT@" == "o"
diff --git a/lib/singleton.rb b/lib/singleton.rb
index 5839458577..d34853702f 100644
--- a/lib/singleton.rb
+++ b/lib/singleton.rb
@@ -239,8 +239,8 @@ class Ups < SomeSingletonClass
puts "Before there were #{num_of_instances(self)}"
sleep 5
puts "Now there is #{num_of_instances(self)}"
- puts "#{@enter.join "; "} was the order of threads entering the waiting loop"
- puts "#{@leave.join "; "} was the order of threads leaving the waiting loop"
+ puts "#{@enter.join '; '} was the order of threads entering the waiting loop"
+ puts "#{@leave.join '; '} was the order of threads leaving the waiting loop"
end
end
end
diff --git a/sample/test.rb b/sample/test.rb
index 2c4f99f1e4..35855acaa4 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1209,15 +1209,16 @@ else
dir << "/"
end
-def valid_syntax?(code)
- eval("BEGIN {return true}\n#{code}")
+def valid_syntax?(code, fname)
+ eval("BEGIN {return true}\n#{code}", nil, fname)
rescue Exception
+ p $!
ensure
false
end
for script in Dir["#{dir}{lib,sample,ext}/**/*.rb"]
- unless valid_syntax? IO::read(script)
+ unless valid_syntax? IO::read(script), script
$bad = true
end
end