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

Commit

Permalink
Merge #6856
Browse files Browse the repository at this point in the history
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 <segiddins@segiddins.me>
Co-authored-by: Colby Swandale <me@colby.fyi>
(cherry picked from commit a63a39d)
  • Loading branch information
bundlerbot authored and colby-swandale committed Dec 30, 2018
1 parent a0ee4cd commit 53e4ffa
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ addons:
secure: "TrzIv116JLGUxm6PAUskCYrv8KTDguncKROVwbnjVPKTGDAgoDderd8JUdDEXrKoZ9qGLD2TPYKExt9/QDl71E+qHdWnVqWv4HKCUk2P9z/VLKzHuggOUBkCXiJUhjywUieCJhI3N92bfq2EjSBbu2/OFHqWOjLQ+QCooTEBjv8="

rvm:
- 2.6.0
- 2.5.3
- 2.4.5
- 2.3.8
- 2.6.0

# Rubygems versions MUST be available as rake tasks
# see Rakefile:125 for the list of possible RGV values
Expand Down
6 changes: 3 additions & 3 deletions bundler.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ rescue LoadError
require File.expand_path("../bundler/version", __FILE__)
end

require "shellwords"

Gem::Specification.new do |s|
s.name = "bundler"
s.version = Bundler::VERSION
Expand Down Expand Up @@ -49,7 +47,9 @@ Gem::Specification.new do |s|
s.add_development_dependency "ronn", "~> 0.7.3"
s.add_development_dependency "rspec", "~> 3.6"

s.files = `git ls-files -z`.split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }
base_dir = File.dirname(__FILE__).gsub(%r{([^A-Za-z0-9_\-.,:\/@\n])}, "\\\\\\1")
s.files = IO.popen("git -C #{base_dir} ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) }

# we don't check in man pages, but we need to ship them because
# we use them to generate the long-form help for each command.
s.files += Dir.glob("man/**/*")
Expand Down
1 change: 1 addition & 0 deletions lib/bundler/current_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CurrentRuby
2.4
2.5
2.6
2.7
].freeze

KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
Expand Down
28 changes: 22 additions & 6 deletions lib/bundler/spec_set.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# frozen_string_literal: true

require "tsort"
require "forwardable"
require "set"

module Bundler
class SpecSet
extend Forwardable
include TSort, Enumerable

def_delegators :@specs, :<<, :length, :add, :remove, :size, :empty?
def_delegators :sorted, :each
include Enumerable
include TSort

def initialize(specs)
@specs = specs
Expand Down Expand Up @@ -132,6 +128,26 @@ def what_required(spec)
what_required(req) << spec
end

def <<(spec)
@specs << spec
end

def length
@specs.length
end

def size
@specs.size
end

def empty?
@specs.empty?
end

def each(&b)
sorted.each(&b)
end

private

def sorted
Expand Down
8 changes: 4 additions & 4 deletions man/gemfile.5.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ used on platforms with Ruby 2.3, use:
The full list of platforms and supported versions includes:

* `ruby`:
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
* `mri`:
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
* `mingw`:
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
* `x64_mingw`:
2.0, 2.1, 2.2, 2.3, 2.4, 2.5
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6

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

Expand Down
3 changes: 2 additions & 1 deletion spec/commands/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,11 @@ def bin_path(a,b,c)
it "overrides disable_shared_gems so bundler can be found" do
skip "bundler 1.16.x is not support with Ruby 2.6 on Travis CI" if RUBY_VERSION >= "2.6"

system_gems :bundler
file = bundled_app("file_that_bundle_execs.rb")
create_file(file, <<-RB)
#!#{Gem.ruby}
puts `bundle exec echo foo`
puts `#{system_bundle_bin_path} exec echo foo`
RB
file.chmod(0o777)
bundle! "exec #{file}", :system_bundler => true
Expand Down
6 changes: 3 additions & 3 deletions spec/lock/lockfile_bundler_1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
it "does not update the lockfile's bundler version if nothing changed during bundle install", :ruby_repo do
version = "#{Bundler::VERSION.split(".").first}.0.0.0.a"

lockfile <<-L
lockfile normalize_uri_file(<<-L)
GEM
remote: file://localhost#{gem_repo1}/
specs:
Expand All @@ -94,13 +94,13 @@
#{version}
L

install_gemfile <<-G
install_gemfile normalize_uri_file(<<-G)
source "file://localhost#{gem_repo1}"
gem "rack"
G

lockfile_should_be <<-G
lockfile_should_be normalize_uri_file(<<-G)
GEM
remote: file://localhost#{gem_repo1}/
specs:
Expand Down
6 changes: 5 additions & 1 deletion spec/quality_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ def check_for_specific_pronouns(filename)
end
end

expect(last_command.stdboth.split("\n")).to be_well_formed
warnings = last_command.stdboth.split("\n")
# ignore warnings around deprecated Object#=~ method in RubyGems
warnings.reject! {|w| w =~ %r{rubygems\/version.rb.*deprecated\ Object#=~} }

expect(warnings).to be_well_formed
end
end
end
4 changes: 3 additions & 1 deletion spec/runtime/setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,9 @@ def clean_load_path(lp)
end
end

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

ENV["GEM_PATH"] = symlinked_gem_home.path
Expand Down
2 changes: 1 addition & 1 deletion spec/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def bundle(cmd, options = {})
bundle_bin = options.delete("bundle_bin") || bindir.join("bundle")

if system_bundler = options.delete(:system_bundler)
bundle_bin = "-S bundle"
bundle_bin = system_bundle_bin_path
end

env = options.delete(:env) || {}
Expand Down
4 changes: 4 additions & 0 deletions spec/support/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def system_gem_path(*path)
tmp("gems/system", *path)
end

def system_bundle_bin_path
system_gem_path("bin/bundle")
end

def lib_path(*args)
tmp("libs", *args)
end
Expand Down

0 comments on commit 53e4ffa

Please sign in to comment.