diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-26 12:43:53 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-26 16:45:35 +0900 |
commit | 8dab71b9d0e9d2054dfb8d703656d4e6712a9efd (patch) | |
tree | a0a6622eb7c486375a3f7d2989772431dc03c7be | |
parent | eb75f0d1346c5f3f74ad91e4e9bbc1eb7ea697f6 (diff) | |
download | ruby-8dab71b9d0e9d2054dfb8d703656d4e6712a9efd.tar.gz |
Simplified single script case
Simply use `File.basename` to remove the directory name (and
suffix), instead of `gsub` which can replace unintended parts.
-rwxr-xr-x | tool/rbinstall.rb | 2 |
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 |