summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-26 12:43:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-26 16:45:35 +0900
commit8dab71b9d0e9d2054dfb8d703656d4e6712a9efd (patch)
treea0a6622eb7c486375a3f7d2989772431dc03c7be /tool/rbinstall.rb
parenteb75f0d1346c5f3f74ad91e4e9bbc1eb7ea697f6 (diff)
Simplified single script case
Simply use `File.basename` to remove the directory name (and suffix), instead of `gsub` which can replace unintended parts.
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb2
1 files changed, 1 insertions, 1 deletions
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