ruby-changes:60199
From: Nobuyoshi <ko1@a...>
Date: Wed, 26 Feb 2020 16:46:08 +0900 (JST)
Subject: [ruby-changes:60199] 8dab71b9d0 (master): Simplified single script case
https://git.ruby-lang.org/ruby.git/commit/?id=8dab71b9d0 From 8dab71b9d0e9d2054dfb8d703656d4e6712a9efd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 26 Feb 2020 12:43:53 +0900 Subject: Simplified single script case Simply use `File.basename` to remove the directory name (and suffix), instead of `gsub` which can replace unintended parts. diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 3333692..9cd9924 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -675,7 +675,7 @@ module RbInstall https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L675 remove_prefix(prefix, ruby_source) end else - [remove_prefix(File.dirname(@gemspec) + '/', @gemspec.gsub(/gemspec/, 'rb'))] + [File.basename(@gemspec, '.gemspec') + '.rb'] end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/