mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5
This commit is contained in:
parent
479ba9a44b
commit
678d58c850
Notes:
git
2022-04-28 19:09:13 +09:00
40 changed files with 72 additions and 76 deletions
|
@ -370,7 +370,7 @@ EOF
|
|||
|
||||
if env.key?("RUBYLIB")
|
||||
rubylib = env["RUBYLIB"].split(File::PATH_SEPARATOR)
|
||||
rubylib.delete(File.expand_path("..", __FILE__))
|
||||
rubylib.delete(__dir__)
|
||||
env["RUBYLIB"] = rubylib.join(File::PATH_SEPARATOR)
|
||||
end
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ module Bundler
|
|||
|
||||
# If Bundler has been installed without its .git directory and without a
|
||||
# commit instance variable then we can't determine its commits SHA.
|
||||
git_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
|
||||
git_dir = File.expand_path("../../../.git", __dir__)
|
||||
if File.directory?(git_dir)
|
||||
return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
|
||||
end
|
||||
|
|
|
@ -610,7 +610,7 @@ module Bundler
|
|||
private :gem
|
||||
|
||||
def self.source_root
|
||||
File.expand_path(File.join(File.dirname(__FILE__), "templates"))
|
||||
File.expand_path("templates", __dir__)
|
||||
end
|
||||
|
||||
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
|
||||
|
|
|
@ -47,7 +47,7 @@ module Bundler
|
|||
def print_gem_path(spec)
|
||||
name = spec.name
|
||||
if name == "bundler"
|
||||
path = File.expand_path("../../../..", __FILE__)
|
||||
path = File.expand_path("../../..", __dir__)
|
||||
else
|
||||
path = spec.full_gem_path
|
||||
if spec.deleted_gem?
|
||||
|
|
|
@ -32,7 +32,7 @@ module Bundler
|
|||
file << spec.to_gemfile
|
||||
end
|
||||
else
|
||||
FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
|
||||
FileUtils.cp(File.expand_path("../templates/#{gemfile}", __dir__), gemfile)
|
||||
end
|
||||
|
||||
puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
|
||||
|
|
|
@ -18,7 +18,7 @@ module Bundler
|
|||
|
||||
if gem_name
|
||||
if gem_name == "bundler"
|
||||
path = File.expand_path("../../../..", __FILE__)
|
||||
path = File.expand_path("../../..", __dir__)
|
||||
else
|
||||
spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
|
||||
return unless spec
|
||||
|
|
|
@ -119,7 +119,7 @@ module Bundler
|
|||
relative_gemfile_path = relative_gemfile_path
|
||||
ruby_command = Thor::Util.ruby_command
|
||||
ruby_command = ruby_command
|
||||
template_path = File.expand_path("../templates/Executable", __FILE__)
|
||||
template_path = File.expand_path("templates/Executable", __dir__)
|
||||
if spec.name == "bundler"
|
||||
template_path += ".bundler"
|
||||
spec.executables = %(bundle)
|
||||
|
@ -172,7 +172,7 @@ module Bundler
|
|||
end
|
||||
standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
|
||||
standalone_path = standalone_path
|
||||
template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__))
|
||||
template = File.read(File.expand_path("templates/Executable.standalone", __dir__))
|
||||
ruby_command = Thor::Util.ruby_command
|
||||
ruby_command = ruby_command
|
||||
|
||||
|
|
|
@ -274,10 +274,10 @@ module Bundler
|
|||
|
||||
def set_bundle_variables
|
||||
# bundler exe & lib folders have same root folder, typical gem installation
|
||||
exe_file = File.expand_path("../../../exe/bundle", __FILE__)
|
||||
exe_file = File.expand_path("../../exe/bundle", __dir__)
|
||||
|
||||
# for Ruby core repository testing
|
||||
exe_file = File.expand_path("../../../libexec/bundle", __FILE__) unless File.exist?(exe_file)
|
||||
exe_file = File.expand_path("../../libexec/bundle", __dir__) unless File.exist?(exe_file)
|
||||
|
||||
# bundler is a default gem, exe path is separate
|
||||
exe_file = Bundler.rubygems.bin_path("bundler", "bundle", VERSION) unless File.exist?(exe_file)
|
||||
|
@ -309,7 +309,7 @@ module Bundler
|
|||
end
|
||||
|
||||
def bundler_ruby_lib
|
||||
resolve_path File.expand_path("../..", __FILE__)
|
||||
File.expand_path("..", __dir__)
|
||||
end
|
||||
|
||||
def clean_load_path
|
||||
|
|
|
@ -22,7 +22,7 @@ module Bundler
|
|||
s.summary = "The best way to manage your application's dependencies"
|
||||
s.executables = %w[bundle]
|
||||
# can't point to the actual gemspec or else the require paths will be wrong
|
||||
s.loaded_from = File.expand_path("..", __FILE__)
|
||||
s.loaded_from = __dir__
|
||||
end
|
||||
|
||||
if local_spec = Bundler.rubygems.find_bundler(VERSION)
|
||||
|
|
|
@ -8,11 +8,9 @@
|
|||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
|
||||
Pathname.new(__FILE__).realpath)
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
||||
|
||||
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
||||
bundle_binstub = File.expand_path("bundle", __dir__)
|
||||
|
||||
if File.file?(bundle_binstub)
|
||||
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
||||
|
|
|
@ -41,7 +41,7 @@ m = Module.new do
|
|||
gemfile = ENV["BUNDLE_GEMFILE"]
|
||||
return gemfile if gemfile && !gemfile.empty?
|
||||
|
||||
File.expand_path("../<%= relative_gemfile_path %>", __FILE__)
|
||||
File.expand_path("<%= relative_gemfile_path %>", __dir__)
|
||||
end
|
||||
|
||||
def lockfile
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
# this file is here to facilitate running it.
|
||||
#
|
||||
|
||||
require "pathname"
|
||||
path = Pathname.new(__FILE__)
|
||||
$:.unshift File.expand_path "../<%= standalone_path %>", path.realpath
|
||||
$:.unshift File.expand_path "<%= standalone_path %>", __dir__
|
||||
|
||||
require "bundler/setup"
|
||||
load File.expand_path "../<%= executable_path %>", path.realpath
|
||||
load File.expand_path "<%= executable_path %>", __dir__
|
||||
|
|
|
@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|||
|
||||
# Specify which files should be added to the gem when it is released.
|
||||
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
||||
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
||||
spec.files = Dir.chdir(__dir__) do
|
||||
`git ls-files -z`.split("\x0").reject do |f|
|
||||
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
||||
end
|
||||
|
|
|
@ -112,7 +112,7 @@ require_relative 'rubygems/errors'
|
|||
# -The RubyGems Team
|
||||
|
||||
module Gem
|
||||
RUBYGEMS_DIR = File.dirname File.expand_path(__FILE__)
|
||||
RUBYGEMS_DIR = __dir__
|
||||
|
||||
# Taint support is deprecated in Ruby 2.7.
|
||||
# This allows switching ".untaint" to ".tap(&Gem::UNTAINT)",
|
||||
|
|
|
@ -341,7 +341,7 @@ By default, this RubyGems will install gem as:
|
|||
|
||||
fake_spec = Gem::Specification.new 'rubygems', Gem::VERSION
|
||||
def fake_spec.full_gem_path
|
||||
File.expand_path '../../../..', __FILE__
|
||||
File.expand_path '../../..', __dir__
|
||||
end
|
||||
|
||||
generate_ri = options[:document].include? 'ri'
|
||||
|
|
|
@ -39,7 +39,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||
# workaround for https://github.com/oracle/truffleruby/issues/2115
|
||||
siteconf_path = RUBY_ENGINE == "truffleruby" ? siteconf.path.dup : siteconf.path
|
||||
require "shellwords"
|
||||
cmd = Gem.ruby.shellsplit << "-I" << File.expand_path("../../..", __FILE__) <<
|
||||
cmd = Gem.ruby.shellsplit << "-I" << File.expand_path('../..', __dir__) <<
|
||||
"-r" << get_relative_path(siteconf_path, extension_dir) << File.basename(extension)
|
||||
cmd.push(*args)
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class Gem::Request
|
|||
def cert_files; @connection_pool.cert_files; end
|
||||
|
||||
def self.get_cert_files
|
||||
pattern = File.expand_path("./ssl_certs/*/*.pem", File.dirname(__FILE__))
|
||||
pattern = File.expand_path("./ssl_certs/*/*.pem", __dir__)
|
||||
Dir.glob(pattern)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
load File.expand_path("../bundle", __FILE__)
|
||||
load File.expand_path("bundle", __dir__)
|
||||
|
|
|
@ -798,7 +798,7 @@ RSpec.describe "bundle install with gem sources" do
|
|||
it "includes the standalone path" do
|
||||
bundle "binstubs rack", :standalone => true
|
||||
standalone_line = File.read(bundled_app("bin/rackup")).each_line.find {|line| line.include? "$:.unshift" }.strip
|
||||
expect(standalone_line).to eq %($:.unshift File.expand_path "../../bundle", path.realpath)
|
||||
expect(standalone_line).to eq %($:.unshift File.expand_path "../bundle", __dir__)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1147,7 +1147,7 @@ RSpec.describe "bundle update --bundler" do
|
|||
end
|
||||
|
||||
it "updates the bundler version in the lockfile without re-resolving if the highest version is already installed" do
|
||||
system_gems "bundler-2.3.3"
|
||||
system_gems "bundler-2.3.9"
|
||||
|
||||
build_repo4 do
|
||||
build_gem "rack", "1.0"
|
||||
|
@ -1157,7 +1157,7 @@ RSpec.describe "bundle update --bundler" do
|
|||
source "#{file_uri_for(gem_repo4)}"
|
||||
gem "rack"
|
||||
G
|
||||
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.3")
|
||||
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.9")
|
||||
|
||||
bundle :update, :bundler => true, :artifice => "compact_index", :verbose => true
|
||||
expect(out).to include("Using bundler #{Bundler::VERSION}")
|
||||
|
@ -1182,7 +1182,7 @@ RSpec.describe "bundle update --bundler" do
|
|||
end
|
||||
|
||||
it "updates the bundler version in the lockfile even if the latest version is not installed", :ruby_repo, :realworld do
|
||||
pristine_system_gems "bundler-2.3.3"
|
||||
pristine_system_gems "bundler-2.3.9"
|
||||
|
||||
build_repo4 do
|
||||
build_gem "rack", "1.0"
|
||||
|
@ -1192,16 +1192,16 @@ RSpec.describe "bundle update --bundler" do
|
|||
source "#{file_uri_for(gem_repo4)}"
|
||||
gem "rack"
|
||||
G
|
||||
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.3")
|
||||
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.9")
|
||||
|
||||
bundle :update, :bundler => true, :artifice => "vcr", :verbose => true
|
||||
|
||||
# Only updates properly on modern RubyGems.
|
||||
|
||||
if Gem.rubygems_version >= Gem::Version.new("3.3.0.dev")
|
||||
expect(out).to include("Updating bundler to 2.3.4")
|
||||
expect(out).to include("Using bundler 2.3.4")
|
||||
expect(out).not_to include("Installing Bundler 2.3.3 and restarting using that version.")
|
||||
expect(out).to include("Updating bundler to 2.3.10")
|
||||
expect(out).to include("Using bundler 2.3.10")
|
||||
expect(out).not_to include("Installing Bundler 2.3.9 and restarting using that version.")
|
||||
|
||||
expect(lockfile).to eq <<~L
|
||||
GEM
|
||||
|
@ -1216,17 +1216,17 @@ RSpec.describe "bundle update --bundler" do
|
|||
rack
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.4
|
||||
2.3.10
|
||||
L
|
||||
|
||||
expect(the_bundle).to include_gems "bundler 2.3.4"
|
||||
expect(the_bundle).to include_gems "bundler 2.3.10"
|
||||
end
|
||||
|
||||
expect(the_bundle).to include_gems "rack 1.0"
|
||||
end
|
||||
|
||||
it "errors if the explicit target version does not exist", :realworld do
|
||||
pristine_system_gems "bundler-2.3.3"
|
||||
pristine_system_gems "bundler-2.3.9"
|
||||
|
||||
build_repo4 do
|
||||
build_gem "rack", "1.0"
|
||||
|
@ -1236,7 +1236,7 @@ RSpec.describe "bundle update --bundler" do
|
|||
source "#{file_uri_for(gem_repo4)}"
|
||||
gem "rack"
|
||||
G
|
||||
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.3")
|
||||
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.9")
|
||||
|
||||
bundle :update, :bundler => "999.999.999", :artifice => "vcr", :raise_on_error => false
|
||||
|
||||
|
@ -1286,7 +1286,7 @@ RSpec.describe "bundle update --bundler" do
|
|||
end
|
||||
|
||||
it "does not touch the network if not necessary" do
|
||||
system_gems "bundler-2.3.3"
|
||||
system_gems "bundler-2.3.9"
|
||||
|
||||
build_repo4 do
|
||||
build_gem "rack", "1.0"
|
||||
|
@ -1297,7 +1297,7 @@ RSpec.describe "bundle update --bundler" do
|
|||
gem "rack"
|
||||
G
|
||||
|
||||
bundle :update, :bundler => "2.3.3", :raise_on_error => false
|
||||
bundle :update, :bundler => "2.3.9", :raise_on_error => false
|
||||
|
||||
expect(out).not_to include("Fetching gem metadata from https://rubygems.org/")
|
||||
|
||||
|
@ -1317,10 +1317,10 @@ RSpec.describe "bundle update --bundler" do
|
|||
rack
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.3
|
||||
2.3.9
|
||||
L
|
||||
|
||||
expect(out).to include("Using bundler 2.3.3")
|
||||
expect(out).to include("Using bundler 2.3.9")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1180,7 +1180,7 @@ RSpec.describe "bundle install with git sources" do
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
File.open("\#{path}/foo.rb", "w") do |f|
|
||||
f.puts "FOO = 'YES'"
|
||||
|
@ -1273,7 +1273,7 @@ In Gemfile:
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
cur_time = Time.now.to_f.to_s
|
||||
File.open("\#{path}/foo.rb", "w") do |f|
|
||||
|
@ -1314,7 +1314,7 @@ In Gemfile:
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
cur_time = Time.now.to_f.to_s
|
||||
File.open("\#{path}/foo.rb", "w") do |f|
|
||||
|
@ -1357,7 +1357,7 @@ In Gemfile:
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
cur_time = Time.now.to_f.to_s
|
||||
File.open("\#{path}/foo.rb", "w") do |f|
|
||||
|
|
|
@ -137,7 +137,7 @@ RSpec.describe "bundle install with explicit source paths" do
|
|||
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
gem 'foo', :path => File.expand_path("../foo-1.0", __FILE__)
|
||||
gem 'foo', :path => File.expand_path("foo-1.0", __dir__)
|
||||
G
|
||||
|
||||
bundle "config set --local frozen true"
|
||||
|
|
|
@ -258,7 +258,7 @@ The checksum of /versions does not match the checksum provided by the server! So
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
File.open("\#{path}/net_build_extensions.rb", "w") do |f|
|
||||
f.puts "NET_BUILD_EXTENSIONS = 'YES'"
|
||||
|
|
|
@ -7,7 +7,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
File.open("\#{path}/implicit_rake_dep.rb", "w") do |f|
|
||||
f.puts "IMPLICIT_RAKE_DEP = 'YES'"
|
||||
|
@ -20,7 +20,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
File.open("\#{path}/another_implicit_rake_dep.rb", "w") do |f|
|
||||
f.puts "ANOTHER_IMPLICIT_RAKE_DEP = 'YES'"
|
||||
|
@ -42,7 +42,7 @@ RSpec.describe "bundle install with install-time dependencies" do
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
File.open("\#{path}/net_build_extensions.rb", "w") do |f|
|
||||
f.puts "NET_BUILD_EXTENSIONS = 'YES'"
|
||||
|
|
|
@ -205,7 +205,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
build_git "bar", :gemspec => false do |s|
|
||||
s.write "lib/bar/version.rb", %(BAR_VERSION = '1.0')
|
||||
s.write "bar.gemspec", <<-G
|
||||
lib = File.expand_path('../lib/', __FILE__)
|
||||
lib = File.expand_path('lib/', __dir__)
|
||||
$:.unshift lib unless $:.include?(lib)
|
||||
require 'bar/version'
|
||||
|
||||
|
@ -419,7 +419,7 @@ RSpec.shared_examples "bundle install --standalone" do
|
|||
|
||||
it "creates stubs with the correct load path" do
|
||||
extension_line = File.read(bundled_app("bin/rails")).each_line.find {|line| line.include? "$:.unshift" }.strip
|
||||
expect(extension_line).to eq %($:.unshift File.expand_path "../../bundle", path.realpath)
|
||||
expect(extension_line).to eq %($:.unshift File.expand_path "../bundle", __dir__)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ RSpec.describe "when using sudo", :sudo => true do
|
|||
s.extensions << "Rakefile"
|
||||
s.write "Rakefile", <<-RUBY
|
||||
task :default do
|
||||
path = File.expand_path("../lib", __FILE__)
|
||||
path = File.expand_path("lib", __dir__)
|
||||
FileUtils.mkdir_p(path)
|
||||
File.open("\#{path}/another_implicit_rake_dep.rb", "w") do |f|
|
||||
f.puts "ANOTHER_IMPLICIT_RAKE_DEP = 'YES'"
|
||||
|
|
|
@ -897,7 +897,7 @@ RSpec.describe "the lockfile format" do
|
|||
|
||||
install_gemfile <<-G
|
||||
source "#{file_uri_for(gem_repo1)}"
|
||||
path File.expand_path("../foo", __FILE__) do
|
||||
path File.expand_path("foo", __dir__) do
|
||||
gem "foo"
|
||||
end
|
||||
G
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rubygems'
|
||||
|
||||
# If bundler gemspec exists, add to stubs
|
||||
bundler_gemspec = File.expand_path("../../../bundler/bundler.gemspec", __FILE__)
|
||||
bundler_gemspec = File.expand_path('../../bundler/bundler.gemspec', __dir__)
|
||||
if File.exist?(bundler_gemspec)
|
||||
Gem::Specification.dirs.unshift File.dirname(bundler_gemspec)
|
||||
Gem::Specification.class_variable_set :@@stubs, nil
|
||||
|
|
|
@ -10,7 +10,7 @@ require 'rbconfig'
|
|||
class TestGem < Gem::TestCase
|
||||
PLUGINS_LOADED = [] # rubocop:disable Style/MutableConstant
|
||||
|
||||
PROJECT_DIR = File.expand_path('../../..', __FILE__).tap(&Gem::UNTAINT)
|
||||
PROJECT_DIR = File.expand_path('../..', __dir__).tap(&Gem::UNTAINT)
|
||||
|
||||
def setup
|
||||
super
|
||||
|
|
|
@ -3,7 +3,7 @@ require_relative 'helper'
|
|||
require 'rubygems/command_manager'
|
||||
|
||||
class TestGemCommandManager < Gem::TestCase
|
||||
PROJECT_DIR = File.expand_path('../../..', __FILE__).tap(&Gem::UNTAINT)
|
||||
PROJECT_DIR = File.expand_path('../..', __dir__).tap(&Gem::UNTAINT)
|
||||
|
||||
def setup
|
||||
super
|
||||
|
|
|
@ -11,7 +11,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase
|
|||
|
||||
@cmd = Gem::Commands::HelpCommand.new
|
||||
|
||||
load File.expand_path('../rubygems_plugin.rb', __FILE__) unless Gem::Commands.const_defined? :InterruptCommand
|
||||
load File.expand_path('rubygems_plugin.rb', __dir__) unless Gem::Commands.const_defined? :InterruptCommand
|
||||
end
|
||||
|
||||
def test_gem_help_bad
|
||||
|
|
|
@ -4,7 +4,7 @@ require_relative 'helper'
|
|||
require 'rubygems/commands/setup_command'
|
||||
|
||||
class TestGemCommandsSetupCommand < Gem::TestCase
|
||||
bundler_gemspec = File.expand_path("../../../bundler/lib/bundler/version.rb", __FILE__)
|
||||
bundler_gemspec = File.expand_path('../../bundler/lib/bundler/version.rb', __dir__)
|
||||
if File.exist?(bundler_gemspec)
|
||||
BUNDLER_VERS = File.read(bundler_gemspec).match(/VERSION = "(#{Gem::Version::VERSION_PATTERN})"/)[1]
|
||||
else
|
||||
|
|
|
@ -941,7 +941,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_install_legacy_spec_with_nil_required_ruby_version
|
||||
path = File.expand_path "../data/null-required-ruby-version.gemspec.rz", __FILE__
|
||||
path = File.expand_path 'data/null-required-ruby-version.gemspec.rz', __dir__
|
||||
spec = Marshal.load Gem.read_binary(path)
|
||||
def spec.validate(*args); end
|
||||
|
||||
|
@ -966,7 +966,7 @@ class TestGemDependencyInstaller < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_install_legacy_spec_with_nil_required_rubygems_version
|
||||
path = File.expand_path "../data/null-required-rubygems-version.gemspec.rz", __FILE__
|
||||
path = File.expand_path 'data/null-required-rubygems-version.gemspec.rz', __dir__
|
||||
spec = Marshal.load Gem.read_binary(path)
|
||||
def spec.validate(*args); end
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ install:
|
|||
File.open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f|
|
||||
f.write <<-'RUBY'
|
||||
puts "IN EXTCONF"
|
||||
extconf_args = File.join File.dirname(__FILE__), 'extconf_args'
|
||||
extconf_args = File.join __dir__, 'extconf_args'
|
||||
File.open extconf_args, 'w' do |f|
|
||||
f.puts ARGV.inspect
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
|||
def setup_rust_gem(name)
|
||||
@ext = File.join(@tempdir, 'ext')
|
||||
@dest_path = File.join(@tempdir, 'prefix')
|
||||
@fixture_dir = Pathname.new(File.expand_path("../test_gem_ext_cargo_builder/#{name}/", __FILE__))
|
||||
@fixture_dir = Pathname.new(File.expand_path("test_gem_ext_cargo_builder/#{name}/", __dir__))
|
||||
|
||||
FileUtils.mkdir_p @dest_path
|
||||
FileUtils.cp_r(@fixture_dir.to_s, @ext)
|
||||
|
@ -103,7 +103,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
|||
Dir.chdir @ext do
|
||||
require 'tmpdir'
|
||||
|
||||
gem = [@rust_envs, *ruby_with_rubygems_in_load_path, File.expand_path("./../../../bin/gem", __FILE__)]
|
||||
gem = [@rust_envs, *ruby_with_rubygems_in_load_path, File.expand_path('../../bin/gem', __dir__)]
|
||||
|
||||
Dir.mktmpdir("rust_ruby_example") do |dir|
|
||||
built_gem = File.expand_path(File.join(dir, "rust_ruby_example.gem"))
|
||||
|
@ -125,7 +125,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
|||
Dir.chdir @ext do
|
||||
require 'tmpdir'
|
||||
|
||||
gem = [@rust_envs, *ruby_with_rubygems_in_load_path, File.expand_path("./../../../bin/gem", __FILE__)]
|
||||
gem = [@rust_envs, *ruby_with_rubygems_in_load_path, File.expand_path('../../bin/gem', __dir__)]
|
||||
|
||||
Dir.mktmpdir("custom_name") do |dir|
|
||||
built_gem = File.expand_path(File.join(dir, "custom_name.gem"))
|
||||
|
|
|
@ -9,9 +9,9 @@ end
|
|||
|
||||
require 'tmpdir'
|
||||
|
||||
lp = File.expand_path("./../../../../../lib", __FILE__)
|
||||
gem = ["ruby", "-I#{lp}", File.expand_path("./../../../../../bin/gem", __FILE__)]
|
||||
gemspec = File.expand_path("./../custom_name.gemspec", __FILE__)
|
||||
lp = File.expand_path('../../../../lib', __dir__)
|
||||
gem = ["ruby", "-I#{lp}", File.expand_path('../../../../bin/gem', __dir__)]
|
||||
gemspec = File.expand_path('custom_name.gemspec', __dir__)
|
||||
|
||||
Dir.mktmpdir("custom_name") do |dir|
|
||||
built_gem = File.expand_path(File.join(dir, "custom_name.gem"))
|
||||
|
|
|
@ -9,9 +9,9 @@ end
|
|||
|
||||
require 'tmpdir'
|
||||
|
||||
lp = File.expand_path("./../../../../../lib", __FILE__)
|
||||
gem = ["ruby", "-I#{lp}", File.expand_path("./../../../../../bin/gem", __FILE__)]
|
||||
gemspec = File.expand_path("./../rust_ruby_example.gemspec", __FILE__)
|
||||
lp = File.expand_path('../../../../lib', __dir__)
|
||||
gem = ["ruby", "-I#{lp}", File.expand_path('../../../../bin/gem', __dir__)]
|
||||
gemspec = File.expand_path('rust_ruby_example.gemspec', __dir__)
|
||||
|
||||
Dir.mktmpdir("rust_ruby_example") do |dir|
|
||||
built_gem = File.expand_path(File.join(dir, "rust_ruby_example.gem"))
|
||||
|
|
|
@ -1068,7 +1068,7 @@ dependencies: []
|
|||
end
|
||||
|
||||
def test_handles_private_null_type
|
||||
path = File.expand_path "../data/null-type.gemspec.rz", __FILE__
|
||||
path = File.expand_path 'data/null-type.gemspec.rz', __dir__
|
||||
|
||||
data = Marshal.load Gem::Util.inflate(Gem.read_binary(path))
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ require "open3"
|
|||
|
||||
class TestProjectSanity < Gem::TestCase
|
||||
def test_manifest_is_up_to_date
|
||||
pend unless File.exist?(File.expand_path("../../../Rakefile", __FILE__))
|
||||
pend unless File.exist?(File.expand_path('../../Rakefile', __dir__))
|
||||
|
||||
_, status = Open3.capture2e("rake check_manifest")
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ class TestGemRequire < Gem::TestCase
|
|||
|
||||
pend "not installed yet" unless RbConfig::TOPDIR
|
||||
|
||||
lib_dir = File.expand_path("../../lib", File.dirname(__FILE__))
|
||||
lib_dir = File.expand_path("../lib", __dir__)
|
||||
rubylibdir = File.realdirpath(RbConfig::CONFIG["rubylibdir"])
|
||||
if rubylibdir == lib_dir
|
||||
# testing in the ruby repository where RubyGems' lib/ == stdlib lib/
|
||||
|
|
Loading…
Reference in a new issue