From c47d59a0a736cefc7bbf80232f3175676a528ad1 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 5 May 2014 16:11:00 +0000 Subject: [PATCH] * benchmark/driver.rb: define File::NULL if not defiend and /dev/null is available to run benchmark driver on ruby 1.9.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ benchmark/driver.rb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index cb517a784f..c76c806ad7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue May 6 01:08:01 2014 Koichi Sasada + + * benchmark/driver.rb: define File::NULL if not defiend and /dev/null + is available to run benchmark driver on ruby 1.9.2. + Mon May 5 23:53:24 2014 Tanaka Akira * ext/socket/mkconstants.rb: Add IP_TRANSPARENT. diff --git a/benchmark/driver.rb b/benchmark/driver.rb index cbc72cf604..a8b524d926 100644 --- a/benchmark/driver.rb +++ b/benchmark/driver.rb @@ -238,6 +238,12 @@ class BenchmarkDriver result end + unless defined?(File::NULL) + if File.exist?('/dev/null') + File::NULL = '/dev/null' + end + end + def measure executable, file cmd = "#{executable} #{@ruby_arg} #{file}"