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

Commit 53e4ffa

Browse files
bundlerbotsegiddinsColby Swandale
committed
Merge #6856
6856: Test against Ruby 2.6 and RubyGems 3 r=colby-swandale a=segiddins The problem was we weren't testing our compatibility with the latest and greatest. Co-authored-by: Samuel Giddins <[email protected]> Co-authored-by: Colby Swandale <[email protected]> (cherry picked from commit a63a39d)
1 parent a0ee4cd commit 53e4ffa

File tree

11 files changed

+49
-21
lines changed

11 files changed

+49
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ addons:
2929
secure: "TrzIv116JLGUxm6PAUskCYrv8KTDguncKROVwbnjVPKTGDAgoDderd8JUdDEXrKoZ9qGLD2TPYKExt9/QDl71E+qHdWnVqWv4HKCUk2P9z/VLKzHuggOUBkCXiJUhjywUieCJhI3N92bfq2EjSBbu2/OFHqWOjLQ+QCooTEBjv8="
3030

3131
rvm:
32+
- 2.6.0
3233
- 2.5.3
3334
- 2.4.5
3435
- 2.3.8
35-
- 2.6.0
3636

3737
# Rubygems versions MUST be available as rake tasks
3838
# see Rakefile:125 for the list of possible RGV values

bundler.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ rescue LoadError
88
require File.expand_path("../bundler/version", __FILE__)
99
end
1010

11-
require "shellwords"
12-
1311
Gem::Specification.new do |s|
1412
s.name = "bundler"
1513
s.version = Bundler::VERSION
@@ -49,7 +47,9 @@ Gem::Specification.new do |s|
4947
s.add_development_dependency "ronn", "~> 0.7.3"
5048
s.add_development_dependency "rspec", "~> 3.6"
5149

52-
s.files = `git ls-files -z`.split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
50+
base_dir = File.dirname(__FILE__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
51+
s.files = IO.popen("git -C #{base_dir} ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
52+
5353
# we don't check in man pages, but we need to ship them because
5454
# we use them to generate the long-form help for each command.
5555
s.files += Dir.glob("man/**/*")

lib/bundler/current_ruby.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class CurrentRuby
1919
2.4
2020
2.5
2121
2.6
22+
2.7
2223
].freeze
2324

2425
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze

lib/bundler/spec_set.rb

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
# frozen_string_literal: true
22

33
require "tsort"
4-
require "forwardable"
54
require "set"
65

76
module Bundler
87
class SpecSet
9-
extend Forwardable
10-
include TSort, Enumerable
11-
12-
def_delegators :@specs, :<<, :length, :add, :remove, :size, :empty?
13-
def_delegators :sorted, :each
8+
include Enumerable
9+
include TSort
1410

1511
def initialize(specs)
1612
@specs = specs
@@ -132,6 +128,26 @@ def what_required(spec)
132128
what_required(req) << spec
133129
end
134130

131+
def <<(spec)
132+
@specs << spec
133+
end
134+
135+
def length
136+
@specs.length
137+
end
138+
139+
def size
140+
@specs.size
141+
end
142+
143+
def empty?
144+
@specs.empty?
145+
end
146+
147+
def each(&b)
148+
sorted.each(&b)
149+
end
150+
135151
private
136152

137153
def sorted

man/gemfile.5.ronn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ used on platforms with Ruby 2.3, use:
216216
The full list of platforms and supported versions includes:
217217

218218
* `ruby`:
219-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
219+
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
220220
* `mri`:
221-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
221+
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
222222
* `mingw`:
223-
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
223+
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
224224
* `x64_mingw`:
225-
2.0, 2.1, 2.2, 2.3, 2.4, 2.5
225+
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
226226

227227
As with groups, you can specify one or more platforms:
228228

spec/commands/exec_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,11 @@ def bin_path(a,b,c)
765765
it "overrides disable_shared_gems so bundler can be found" do
766766
skip "bundler 1.16.x is not support with Ruby 2.6 on Travis CI" if RUBY_VERSION >= "2.6"
767767

768+
system_gems :bundler
768769
file = bundled_app("file_that_bundle_execs.rb")
769770
create_file(file, <<-RB)
770771
#!#{Gem.ruby}
771-
puts `bundle exec echo foo`
772+
puts `#{system_bundle_bin_path} exec echo foo`
772773
RB
773774
file.chmod(0o777)
774775
bundle! "exec #{file}", :system_bundler => true

spec/lock/lockfile_bundler_1_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
it "does not update the lockfile's bundler version if nothing changed during bundle install", :ruby_repo do
7979
version = "#{Bundler::VERSION.split(".").first}.0.0.0.a"
8080

81-
lockfile <<-L
81+
lockfile normalize_uri_file(<<-L)
8282
GEM
8383
remote: file://localhost#{gem_repo1}/
8484
specs:
@@ -94,13 +94,13 @@
9494
#{version}
9595
L
9696

97-
install_gemfile <<-G
97+
install_gemfile normalize_uri_file(<<-G)
9898
source "file://localhost#{gem_repo1}"
9999
100100
gem "rack"
101101
G
102102

103-
lockfile_should_be <<-G
103+
lockfile_should_be normalize_uri_file(<<-G)
104104
GEM
105105
remote: file://localhost#{gem_repo1}/
106106
specs:

spec/quality_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ def check_for_specific_pronouns(filename)
261261
end
262262
end
263263

264-
expect(last_command.stdboth.split("\n")).to be_well_formed
264+
warnings = last_command.stdboth.split("\n")
265+
# ignore warnings around deprecated Object#=~ method in RubyGems
266+
warnings.reject! {|w| w =~ %r{rubygems\/version.rb.*deprecated\ Object#=~} }
267+
268+
expect(warnings).to be_well_formed
265269
end
266270
end
267271
end

spec/runtime/setup_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,9 @@ def clean_load_path(lp)
886886
end
887887
end
888888

889-
it "should succesfully require 'bundler/setup'", :ruby_repo do
889+
# Can't make this pass on 2.6 since the ruby standard library has the same $LOAD_PATH
890+
# entry as bundler (since it's a default gem)
891+
it "should successfully require 'bundler/setup'", :ruby_repo, :ruby => "< 2.6" do
890892
install_gemfile ""
891893

892894
ENV["GEM_PATH"] = symlinked_gem_home.path

spec/support/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def bundle(cmd, options = {})
104104
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")
105105

106106
if system_bundler = options.delete(:system_bundler)
107-
bundle_bin = "-S bundle"
107+
bundle_bin = system_bundle_bin_path
108108
end
109109

110110
env = options.delete(:env) || {}

0 commit comments

Comments
 (0)