From d6cf4c0c997752c9e23876a8d5c205737317a6e3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 8 Jul 2021 17:58:25 +0900 Subject: rbinstall.rb: just call File.basename directly --- tool/rbinstall.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tool/rbinstall.rb') diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 7f522e54d1..305287c637 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -22,7 +22,6 @@ require 'fileutils' require 'shellwords' require 'optparse' require 'optparse/shellwords' -require 'pathname' require 'rubygems' begin require "zlib" @@ -730,7 +729,7 @@ module RbInstall base = @base_dir prefix = base.sub(/lib\/.*?\z/, "") # for lib/net/net-smtp.gemspec - if m = Pathname.new(@gemspec).basename(".gemspec").to_s.match(/.*\-(.*)\z/) + if m = File.basename(@gemspec, ".gemspec").match(/.*\-(.*)\z/) base = "#{@base_dir}/#{m[1]}" unless remove_prefix(prefix, @base_dir).include?(m[1]) end end @@ -743,7 +742,7 @@ module RbInstall [File.basename(@gemspec, '.gemspec') + '.rb'] end - case Pathname.new(@gemspec).basename(".gemspec").to_s + case File.basename(@gemspec, ".gemspec") when "net-http" files << "lib/net/https.rb" when "optparse" -- cgit v1.2.1