From ceff9c8dcb343192f711de8cdbe538c535fab22c Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 24 Jul 2016 21:43:05 +0000 Subject: dtrace: simplify * test/dtrace/helper.rb (DTrace::TestCase::RUBYBIN): simply substitute basename. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dtrace/helper.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'test/dtrace') diff --git a/test/dtrace/helper.rb b/test/dtrace/helper.rb index 4beda271c8..22865aac25 100644 --- a/test/dtrace/helper.rb +++ b/test/dtrace/helper.rb @@ -43,12 +43,8 @@ module DTrace IO.popen(cmd, err: [:child, :out], &:readlines) end - case rubybin = EnvUtil.rubybin - when /\/ruby-runner#{Regexp.quote(RbConfig::CONFIG["EXEEXT"])}\z/ - RUBYBIN = File.dirname(rubybin)+"/miniruby#{RbConfig::CONFIG["EXEEXT"]}" - else - RUBYBIN = rubybin - end + exeext = Regexp.quote(RbConfig::CONFIG["EXEEXT"]) + RUBYBIN = EnvUtil.rubybin.sub(/\/ruby-runner(?=#{exeext}\z)/, '/miniruby') def trap_probe d_program, ruby_program d = Tempfile.new(%w'probe .d') -- cgit v1.2.1