ruby-changes:68516
From: Nobuyoshi <ko1@a...>
Date: Mon, 18 Oct 2021 13:03:06 +0900 (JST)
Subject: [ruby-changes:68516] e1e3657746 (master): Simplify srcdir fallback
https://git.ruby-lang.org/ruby.git/commit/?id=e1e3657746 From e1e3657746b935e8c9ab6f4beccd0aaed45db9dc Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 18 Oct 2021 10:13:15 +0900 Subject: Simplify srcdir fallback --- spec/default.mspec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/default.mspec b/spec/default.mspec index 8791058f95..162fa8b9f2 100644 --- a/spec/default.mspec +++ b/spec/default.mspec @@ -9,11 +9,7 @@ OBJDIR = File.expand_path("spec/ruby/optional/capi/ext") https://github.com/ruby/ruby/blob/trunk/spec/default.mspec#L9 class MSpecScript builddir = Dir.pwd srcdir = ENV['SRCDIR'] - if !srcdir and File.exist?("#{builddir}/Makefile") then - File.open("#{builddir}/Makefile", "r:US-ASCII") {|f| - f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1 - } - end + srcdir ||= File.read("Makefile", encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil srcdir = File.expand_path(srcdir) config = RbConfig::CONFIG -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/