1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix error when srcdir not found

So that `spec/mspec/bin/mspec --help` works at least.
This commit is contained in:
Nobuyoshi Nakada 2021-10-18 10:29:51 +09:00
parent e1e3657746
commit 0bbfb6a37b
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -10,17 +10,19 @@ class MSpecScript
builddir = Dir.pwd
srcdir = ENV['SRCDIR']
srcdir ||= File.read("Makefile", encoding: "US-ASCII")[/^\s*srcdir\s*=\s*(.+)/i, 1] rescue nil
srcdir = File.expand_path(srcdir)
config = RbConfig::CONFIG
# The default implementation to run the specs.
set :target, File.join(builddir, "miniruby#{config['exeext']}")
set :prefix, File.expand_path('ruby', File.dirname(__FILE__))
set :flags, %W[
-I#{srcdir}/lib
#{srcdir}/tool/runruby.rb --archdir=#{Dir.pwd} --extout=#{config['EXTOUT']}
--
]
if srcdir
srcdir = File.expand_path(srcdir)
set :flags, %W[
-I#{srcdir}/lib
#{srcdir}/tool/runruby.rb --archdir=#{builddir} --extout=#{config['EXTOUT']}
--
]
end
end
module MSpecScript::JobServer