Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7301
Browse files Browse the repository at this point in the history
7301: Track changes from ruby core master r=hsbt a=hsbt

### What was the end-user problem that led to this PR?

I'm going to merge #7274. But the ruby-core source has some of the changes for bundler source.

### What was your diagnosis of the problem?


### What is your fix for the problem, implemented in this PR?

ruby core team fixed them:

* Removed circular require warning at `shared_helper.rb`
* Support test at GitHub Actions, It helps that bundler will migrate Actions from Azure Pipelines too.
* Fixed broken examples at ruby core repository


### Why did you choose this fix out of the possible options?



Co-authored-by: ohbarye <over.rye@gmail.com>
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
  • Loading branch information
4 people committed Aug 16, 2019
2 parents 91f91a1 + 9256177 commit 982e415
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/bundler/shared_helpers.rb
Expand Up @@ -2,7 +2,6 @@

require "pathname"
require "rbconfig"
require "rubygems"

require_relative "version"
require_relative "constants"
Expand Down
6 changes: 3 additions & 3 deletions spec/bundler/source_spec.rb
Expand Up @@ -56,7 +56,7 @@ class ExampleSource < Bundler::Source
context "with a different version" do
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "< 1.5") }

context "with color", :non_windows do
context "with color", :no_color_tty do
before { Bundler.ui = Bundler::UI::Shell.new }

it "should return a string with the spec name and version and locked spec version" do
Expand All @@ -77,7 +77,7 @@ class ExampleSource < Bundler::Source
let(:spec) { double(:spec, :name => "nokogiri", :version => "1.6.1", :platform => rb) }
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") }

context "with color", :non_windows do
context "with color", :no_color_tty do
before { Bundler.ui = Bundler::UI::Shell.new }

it "should return a string with the locked spec version in yellow" do
Expand All @@ -98,7 +98,7 @@ class ExampleSource < Bundler::Source
let(:spec) { double(:spec, :name => "nokogiri", :version => "1.7.1", :platform => rb) }
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") }

context "with color", :non_windows do
context "with color", :no_color_tty do
before { Bundler.ui = Bundler::UI::Shell.new }

it "should return a string with the locked spec version in green" do
Expand Down
2 changes: 1 addition & 1 deletion spec/commands/binstubs_spec.rb
Expand Up @@ -264,7 +264,7 @@
end

context "when using --shebang" do
it "sets the specified shebang for the the binstub" do
it "sets the specified shebang for the binstub" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack"
Expand Down
4 changes: 2 additions & 2 deletions spec/commands/exec_spec.rb
Expand Up @@ -55,7 +55,7 @@
expect(out).to eq("hi")
end

it "respects custom process title when loading through ruby" do
it "respects custom process title when loading through ruby", :github_action_linux do
script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~RUBY
Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16")
puts `ps -eo args | grep [1]-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16`
Expand Down Expand Up @@ -299,7 +299,7 @@
G

rubylib = ENV["RUBYLIB"]
rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift bundler_path
rubylib = rubylib.to_s.split(File::PATH_SEPARATOR).unshift bundler_path.to_s
rubylib = rubylib.uniq.join(File::PATH_SEPARATOR)

bundle "exec 'echo $RUBYLIB'"
Expand Down
3 changes: 2 additions & 1 deletion spec/commands/newgem_spec.rb
Expand Up @@ -311,7 +311,8 @@ def create_temporary_dir(dir)
end

it "sets a minimum ruby version" do
bundler_gemspec = Bundler::GemHelper.new(File.expand_path("../..", __dir__)).gemspec
gemspec_path = ruby_core? ? "../../../lib/bundler" : "../.."
bundler_gemspec = Bundler::GemHelper.new(File.expand_path(gemspec_path, __dir__)).gemspec

expect(bundler_gemspec.required_ruby_version).to eq(generated_gemspec.required_ruby_version)
end
Expand Down
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Expand Up @@ -71,7 +71,8 @@ def self.ruby=(ruby)
config.filter_run_excluding :git => RequirementChecker.against(git_version)
config.filter_run_excluding :bundler => RequirementChecker.against(Bundler::VERSION.split(".")[0])
config.filter_run_excluding :ruby_repo => !(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]).nil?
config.filter_run_excluding :non_windows => Gem.win_platform?
config.filter_run_excluding :no_color_tty => Gem.win_platform? || !ENV["GITHUB_ACTION"].nil?
config.filter_run_excluding :github_action_linux => !ENV["GITHUB_ACTION"].nil? && (ENV["RUNNER_OS"] == "Linux")

config.filter_run_when_matching :focus unless ENV["CI"]

Expand Down Expand Up @@ -100,6 +101,7 @@ def self.ruby=(ruby)
ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.spec_dir}/support/hax.rb"
ENV["BUNDLE_SPEC_RUN"] = "true"
ENV["BUNDLE_USER_CONFIG"] = ENV["BUNDLE_USER_CACHE"] = ENV["BUNDLE_USER_PLUGIN"] = nil
ENV["GEMRC"] = nil

# Don't wrap output in tests
ENV["THOR_COLUMNS"] = "10000"
Expand Down

0 comments on commit 982e415

Please sign in to comment.