[rubygems/rubygems] s/ruby!/ruby

https://github.com/rubygems/rubygems/commit/a73fa0760e
This commit is contained in:
David Rodríguez 2020-06-03 20:47:59 +02:00 коммит произвёл Hiroshi SHIBATA
Родитель a572e78201
Коммит 596588c697
6 изменённых файлов: 24 добавлений и 24 удалений

Просмотреть файл

@ -94,7 +94,7 @@ RSpec.describe "bundle open" do
context "when opening a default gem" do
let(:default_gems) do
ruby!(<<-RUBY).split("\n")
ruby(<<-RUBY).split("\n")
if Gem::Specification.is_a?(Enumerable)
puts Gem::Specification.select(&:default_gem?).map(&:name)
end

Просмотреть файл

@ -34,7 +34,7 @@ RSpec.describe "double checking sources", :realworld => true, :sometimes => true
end
RUBY
ruby! cmd
ruby! cmd
ruby cmd
ruby cmd
end
end

Просмотреть файл

@ -2,7 +2,7 @@
RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
def rubygems_version(name, requirement)
ruby! <<-RUBY
ruby <<-RUBY
require "#{spec_dir}/support/artifice/vcr"
require "#{lib_dir}/bundler"
require "#{lib_dir}/bundler/source/rubygems/remote"

Просмотреть файл

@ -81,7 +81,7 @@ RSpec.describe "Bundler.load" do
gem "activesupport", :group => :test
G
ruby! <<-RUBY
ruby <<-RUBY
require "#{lib_dir}/bundler"
Bundler.setup :default
Bundler.require :default

Просмотреть файл

@ -107,7 +107,7 @@ RSpec.describe "Bundler.setup" do
context "load order" do
def clean_load_path(lp)
without_bundler_load_path = ruby!("puts $LOAD_PATH").split("\n")
without_bundler_load_path = ruby("puts $LOAD_PATH").split("\n")
lp -= without_bundler_load_path
lp.map! {|p| p.sub(/^#{Regexp.union system_gem_path.to_s, default_bundle_path.to_s, lib_dir.to_s}/i, "") }
end
@ -143,7 +143,7 @@ RSpec.describe "Bundler.setup" do
gem "rails"
G
ruby! <<-RUBY
ruby <<-RUBY
require '#{lib_dir}/bundler'
Bundler.setup
puts $LOAD_PATH
@ -171,7 +171,7 @@ RSpec.describe "Bundler.setup" do
gem "terranova"
G
ruby! <<-RUBY
ruby <<-RUBY
require '#{lib_dir}/bundler/setup'
puts $LOAD_PATH
RUBY
@ -1158,14 +1158,14 @@ end
context "is not present" do
it "does not change the lock" do
expect { ruby! "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
expect { ruby "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
end
end
context "is newer" do
let(:ruby_version) { "5.5.5" }
it "does not change the lock or warn" do
expect { ruby! "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
expect { ruby "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
expect(out).to be_empty
expect(err).to be_empty
end
@ -1174,7 +1174,7 @@ end
context "is older" do
let(:ruby_version) { "1.0.0" }
it "does not change the lock" do
expect { ruby! "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
expect { ruby "require '#{lib_dir}/bundler/setup'" }.not_to change { lockfile }
end
end
end
@ -1195,7 +1195,7 @@ end
it "does not load openssl" do
install_gemfile ""
ruby! <<-RUBY
ruby <<-RUBY
require "#{lib_dir}/bundler/setup"
puts defined?(OpenSSL) || "undefined"
require "openssl"
@ -1251,7 +1251,7 @@ end
it "activates no gems with -rbundler/setup" do
install_gemfile ""
ruby! code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -r#{lib_dir}/bundler/setup" }
ruby code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -r#{lib_dir}/bundler/setup" }
expect(out).to eq("{}")
end
@ -1359,7 +1359,7 @@ end
gem "rack"
G
ruby! <<-RUBY
ruby <<-RUBY
require "#{lib_dir}/bundler/setup"
Object.new.gem "rack"
puts Gem.loaded_specs["rack"].full_name

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true
RSpec.describe "Bundler.with_env helpers" do
def bundle_exec_ruby!(args, options = {})
def bundle_exec_ruby(args, options = {})
build_bundler_context options
bundle "exec '#{Gem.ruby}' #{args}", options
end
@ -23,7 +23,7 @@ RSpec.describe "Bundler.with_env helpers" do
RUBY
path = `getconf PATH`.strip + "#{File::PATH_SEPARATOR}/foo"
with_path_as(path) do
bundle_exec_ruby!(bundled_app("source.rb").to_s)
bundle_exec_ruby(bundled_app("source.rb").to_s)
expect(last_command.stdboth).to eq(path)
end
end
@ -34,7 +34,7 @@ RSpec.describe "Bundler.with_env helpers" do
RUBY
gem_path = ENV["GEM_PATH"] + "#{File::PATH_SEPARATOR}/foo"
with_gem_path_as(gem_path) do
bundle_exec_ruby!(bundled_app("source.rb").to_s)
bundle_exec_ruby(bundled_app("source.rb").to_s)
expect(last_command.stdboth).to eq(gem_path)
end
end
@ -52,7 +52,7 @@ RSpec.describe "Bundler.with_env helpers" do
path = `getconf PATH`.strip + File::PATH_SEPARATOR + File.dirname(Gem.ruby)
with_path_as(path) do
build_bundler_context
bundle_exec_ruby!("#{bundled_app("exe.rb")} 2")
bundle_exec_ruby("#{bundled_app("exe.rb")} 2")
end
expect(err).to eq <<-EOS.strip
2 false
@ -65,11 +65,11 @@ RSpec.describe "Bundler.with_env helpers" do
# Simulate bundler has not yet been loaded
ENV.replace(ENV.to_hash.delete_if {|k, _v| k.start_with?(Bundler::EnvironmentPreserver::BUNDLER_PREFIX) })
original = ruby!('puts ENV.to_a.map {|e| e.join("=") }.sort.join("\n")')
original = ruby('puts ENV.to_a.map {|e| e.join("=") }.sort.join("\n")')
create_file("source.rb", <<-RUBY)
puts Bundler.original_env.to_a.map {|e| e.join("=") }.sort.join("\n")
RUBY
bundle_exec_ruby! bundled_app("source.rb")
bundle_exec_ruby bundled_app("source.rb")
expect(out).to eq original
end
end
@ -80,7 +80,7 @@ RSpec.describe "Bundler.with_env helpers" do
print #{modified_env}.has_key?('BUNDLE_PATH')
RUBY
ENV["BUNDLE_PATH"] = "./foo"
bundle_exec_ruby! bundled_app("source.rb")
bundle_exec_ruby bundled_app("source.rb")
expect(last_command.stdboth).to include "false"
end
@ -90,7 +90,7 @@ RSpec.describe "Bundler.with_env helpers" do
RUBY
ENV["RUBYOPT"] = "-W2 -rbundler/setup #{ENV["RUBYOPT"]}"
simulate_bundler_version_when_missing_prerelease_default_gem_activation do
bundle_exec_ruby! bundled_app("source.rb")
bundle_exec_ruby bundled_app("source.rb")
end
expect(last_command.stdboth).not_to include("-rbundler/setup")
end
@ -101,7 +101,7 @@ RSpec.describe "Bundler.with_env helpers" do
RUBY
ENV["RUBYLIB"] = lib_dir.to_s + File::PATH_SEPARATOR + "/foo"
ENV["BUNDLER_ORIG_RUBYLIB"] = lib_dir.to_s + File::PATH_SEPARATOR + "/foo-original"
bundle_exec_ruby! bundled_app("source.rb")
bundle_exec_ruby bundled_app("source.rb")
expect(last_command.stdboth).to include("/foo-original")
end
@ -111,7 +111,7 @@ RSpec.describe "Bundler.with_env helpers" do
RUBY
ENV["MANPATH"] = "/foo"
ENV["BUNDLER_ORIG_MANPATH"] = "/foo-original"
bundle_exec_ruby! bundled_app("source.rb")
bundle_exec_ruby bundled_app("source.rb")
expect(last_command.stdboth).to include("/foo-original")
end
end