From 8dab71b9d0e9d2054dfb8d703656d4e6712a9efd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 26 Feb 2020 12:43:53 +0900 Subject: [PATCH] Simplified single script case Simply use `File.basename` to remove the directory name (and suffix), instead of `gsub` which can replace unintended parts. --- tool/rbinstall.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 333369293a..9cd99243a6 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -675,7 +675,7 @@ module RbInstall remove_prefix(prefix, ruby_source) end else - [remove_prefix(File.dirname(@gemspec) + '/', @gemspec.gsub(/gemspec/, 'rb'))] + [File.basename(@gemspec, '.gemspec') + '.rb'] end end