aboutsummaryrefslogtreecommitdiffstats
path: root/yarp
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-08-25 15:43:04 -0400
committergit <svn-admin@ruby-lang.org>2023-08-25 19:43:10 +0000
commitd2392e1ce2b9fb113ca19cdcae2a2fe7f8a3c8ec (patch)
tree7a2cb12f44ea21d84a52ef4e6f74c5d12f3ac39b /yarp
parentf603497105bd41c1863490a557ff105bf7e17830 (diff)
downloadruby-d2392e1ce2b9fb113ca19cdcae2a2fe7f8a3c8ec.tar.gz
[ruby/yarp] Fix relative require in template script
https://github.com/ruby/yarp/commit/dea9eb5a12
Diffstat (limited to 'yarp')
-rwxr-xr-xyarp/templates/template.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/yarp/templates/template.rb b/yarp/templates/template.rb
index 4216c68b95..59a779be1f 100755
--- a/yarp/templates/template.rb
+++ b/yarp/templates/template.rb
@@ -4,7 +4,13 @@ require "erb"
require "fileutils"
require "yaml"
-require_relative "../lib/yarp/version"
+if File.exist?(File.expand_path("../lib/yarp/version", __dir__))
+ # Within the gem/local repository
+ require_relative "../lib/yarp/version"
+else
+ # Within CRuby
+ require_relative "../../lib/yarp/version"
+end
YARP_VERSION = YARP::VERSION
YARP_VERSION_MAJOR, YARP_VERSION_MINOR, YARP_VERSION_PATCH = YARP_VERSION.split(".")