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

Simplified single script case

Simply use `File.basename` to remove the directory name (and
suffix), instead of `gsub` which can replace unintended parts.
This commit is contained in:
Nobuyoshi Nakada 2020-02-26 12:43:53 +09:00
parent eb75f0d134
commit 8dab71b9d0
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -675,7 +675,7 @@ module RbInstall
remove_prefix(prefix, ruby_source) remove_prefix(prefix, ruby_source)
end end
else else
[remove_prefix(File.dirname(@gemspec) + '/', @gemspec.gsub(/gemspec/, 'rb'))] [File.basename(@gemspec, '.gemspec') + '.rb']
end end
end end