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

Commit

Permalink
Merge branch '2-0-stable'
Browse files Browse the repository at this point in the history
* 2-0-stable: (43 commits)
  remove path that i copied from my personal computer
  Auto merge of #6586 - bundler:segiddins/softer-major-deprecations, r=indirect
  Merge #6941
  Merge #6834
  Version 2.0.1 with changelog
  update tested rubygems in travis
  Lower required RubyGems to 2.5 or greater
  Bundler 2.0 with changelog
  update CHANGELOG with new changes and release
  Merge #6856
  add RubyGems v3.0.1 to rg clone task
  Version 2.0.0.pre.3 wih changelog
  update tested versions of RubyGems in travis
  update gemspec to require RubyGems 3.0.0
  Merge #6849
  Merge #6853
  Revert "Version 2.0.0 with changelog"
  Version 2.0.0 with changelog
  fix breaking edge case spec
  Merge #6818
  ...

(cherry picked from commit 77f4c15)
  • Loading branch information
colby-swandale authored and deivid-rodriguez committed Mar 15, 2019
1 parent 1591215 commit e6d4f41
Show file tree
Hide file tree
Showing 62 changed files with 228 additions and 216 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
- rvm: ruby-head
env: RGV=master
stage: test
# 1.x mode (we want to keep stuff passing in 1.x mode for now)
# 3.x mode
- rvm: 2.6.1
env: RGV=v3.0.3 BUNDLER_SPEC_SUB_VERSION=1.98
env: RGV=v3.0.3 BUNDLER_SPEC_SUB_VERSION=3.0.0
stage: test

allow_failures:
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
## 2.0.1 (2019-01-04)

Changes:

- Relaxed RubyGems requirement to `>= 2.5.0` ([#6867](https://github.com/bundler/bundler/pull/6867))

## 2.0.0 (2019-01-03)

No new changes

## 2.0.0.pre.3 (2018-12-30)

Breaking Changes:

- Bundler 2 now requires RubyGems 3.0.0 at minimum

Changes:

- Ruby 2.6 compatibility fixes (@segiddins)
- Import changes from Bundler 1.17.3 release

Note: To upgrade your Gemfile to Bundler 2 you will need to run `bundle update --bundler`

## 2.0.0.pre.2 (2018-11-27)

Breaking Changes:

- `:github` source in the Gemfile now defaults to using HTTPS

Changes

- Add compatibility for Bundler merge into ruby-src

Note: To upgrade your Gemfile to Bundler 2 you will need to run `bundle update --bundler`

## 2.0.0.pre.1 (2018-11-09)

Breaking Changes:

- Dropped support for versions of Ruby < 2.3
- Dropped support for version of RubyGems < 2.5
- Moved error messages from STDOUT to STDERR

Note: To upgrade your Gemfile to Bundler 2 you will need to run `bundle update --bundler`

## 1.17.3 (2018-12-27)

Bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def load
end

def environment
SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
SharedHelpers.major_deprecation 3, "Bundler.environment has been removed in favor of Bundler.load"
load
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/capistrano.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation 2,
Bundler::SharedHelpers.major_deprecation 3,
"The Bundler task for Capistrano. Please use http://github.com/capistrano/bundler"

# Capistrano task for Bundler.
Expand Down
8 changes: 4 additions & 4 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def install
method_option "all", :type => :boolean, :banner =>
"Update everything."
def update(*gems)
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
SharedHelpers.major_deprecation(3, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require "bundler/cli/update"
Update.new(options, gems).run
end
Expand Down Expand Up @@ -303,7 +303,7 @@ def show(gem_name = nil)
old_argv = ARGV.join(" ")
new_argv = [new_command, *new_arguments.compact].join(" ")

Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
Bundler::SharedHelpers.major_deprecation(3, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
end
require "bundler/cli/show"
Show.new(options, gem_name).run
Expand Down Expand Up @@ -535,7 +535,7 @@ def licenses
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
def viz
SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
SharedHelpers.major_deprecation 3, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
require "bundler/cli/viz"
Viz.new(options.dup).run
end
Expand Down Expand Up @@ -606,7 +606,7 @@ def platform
method_option "group", :type => :string, :banner =>
"Install gem into a bundler group"
def inject(name, version)
SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
SharedHelpers.major_deprecation 3, "The `inject` command has been replaced by the `add` command"
require "bundler/cli/inject"
Inject.new(options.dup, name, version).run
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(options, group)
end

def run
Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \
Bundler::SharedHelpers.major_deprecation 3, "bundle console will be replaced " \
"by `bin/console` generated by `bundle gem <name>`"

group ? Bundler.require(:default, *group.split.map!(&:to_sym)) : Bundler.require
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run
Bundler::Fetcher.disable_endpoint = options["full-index"]

if options["binstubs"]
Bundler::SharedHelpers.major_deprecation 2,
Bundler::SharedHelpers.major_deprecation 3,
"The --binstubs option will be removed in favor of `bundle binstubs`"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def run
if Bundler.feature_flag.update_requires_all_flag?
raise InvalidOption, "To update everything, pass the `--all` flag."
end
SharedHelpers.major_deprecation 2, "Pass --all to `bundle update` to update everything"
SharedHelpers.major_deprecation 3, "Pass --all to `bundle update` to update everything"
elsif !full_update && options[:all]
raise InvalidOption, "Cannot specify --all along with specific options."
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def lock(file, preserve_unknown_sections = false)
# i.e., Windows with `git config core.autocrlf=true`
contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n")

if @locked_bundler_version
if @locked_bundler_version && Bundler.feature_flag.lockfile_upgrade_warning?
locked_major = @locked_bundler_version.segments.first
current_major = Gem::Version.create(Bundler::VERSION).segments.first

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/deployment.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \
Bundler::SharedHelpers.major_deprecation 3, "Bundler no longer integrates with " \
"Capistrano, but Capistrano provides its own integration with " \
"Bundler via the capistrano-bundler gem. Use it instead."

Expand Down
8 changes: 4 additions & 4 deletions lib/bundler/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def path(path, options = {}, &blk)
" end\n\n"

raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource?
SharedHelpers.major_deprecation(2, msg.strip)
SharedHelpers.major_deprecation(3, msg.strip)
end

source_options = normalize_hash(options).merge(
Expand Down Expand Up @@ -438,7 +438,7 @@ def validate_keys(command, opts, valid_keys)
def normalize_source(source)
case source
when :gemcutter, :rubygems, :rubyforge
Bundler::SharedHelpers.major_deprecation 2, "The source :#{source} is deprecated because HTTP " \
Bundler::SharedHelpers.major_deprecation 3, "The source :#{source} is deprecated because HTTP " \
"requests are insecure.\nPlease change your source to 'https://" \
"rubygems.org' if possible, or 'http://rubygems.org' if not."
"http://rubygems.org"
Expand All @@ -456,13 +456,13 @@ def check_primary_source_safety(source_list)
msg = "This Gemfile contains multiple primary sources. " \
"Each source after the first must include a block to indicate which gems " \
"should come from that source"
unless Bundler.feature_flag.bundler_2_mode?
unless Bundler.feature_flag.bundler_3_mode?
msg += ". To downgrade this error to a warning, run " \
"`bundle config unset disable_multisource`"
end
raise GemfileEvalError, msg
else
Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple primary sources. " \
Bundler::SharedHelpers.major_deprecation 3, "Your Gemfile contains multiple primary sources. " \
"Using `source` more than once without a block is a security risk, and " \
"may result in installing unexpected gems. To resolve this warning, use " \
"a block to indicate which gems should come from the secondary source. " \
Expand Down
49 changes: 25 additions & 24 deletions lib/bundler/feature_flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,39 @@ def self.settings_method(name, key, &default)

(1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }

settings_flag(:allow_bundler_dependency_conflicts) { bundler_2_mode? }
settings_flag(:allow_offline_install) { bundler_2_mode? }
settings_flag(:auto_clean_without_path) { bundler_2_mode? }
settings_flag(:auto_config_jobs) { bundler_2_mode? }
settings_flag(:cache_all) { bundler_2_mode? }
settings_flag(:cache_command_is_package) { bundler_2_mode? }
settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
settings_flag(:allow_offline_install) { bundler_3_mode? }
settings_flag(:auto_clean_without_path) { bundler_3_mode? }
settings_flag(:auto_config_jobs) { bundler_3_mode? }
settings_flag(:cache_all) { bundler_3_mode? }
settings_flag(:cache_command_is_package) { bundler_3_mode? }
settings_flag(:console_command) { !bundler_3_mode? }
settings_flag(:default_install_uses_path) { bundler_2_mode? }
settings_flag(:deployment_means_frozen) { bundler_2_mode? }
settings_flag(:disable_multisource) { bundler_2_mode? }
settings_flag(:default_install_uses_path) { bundler_3_mode? }
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
settings_flag(:disable_multisource) { bundler_3_mode? }
settings_flag(:error_on_stderr) { bundler_2_mode? }
settings_flag(:forget_cli_options) { bundler_3_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_2_mode? }
settings_flag(:global_gem_cache) { bundler_2_mode? }
settings_flag(:init_gems_rb) { bundler_2_mode? }
settings_flag(:list_command) { bundler_2_mode? }
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_2_mode? }
settings_flag(:path_relative_to_cwd) { bundler_2_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_3_mode? }
settings_flag(:global_gem_cache) { bundler_3_mode? }
settings_flag(:init_gems_rb) { bundler_3_mode? }
settings_flag(:list_command) { bundler_3_mode? }
settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_3_mode? }
settings_flag(:lockfile_upgrade_warning) { bundler_3_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
settings_flag(:prefer_gems_rb) { bundler_2_mode? }
settings_flag(:print_only_version_number) { bundler_2_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_2_mode? }
settings_flag(:prefer_gems_rb) { bundler_3_mode? }
settings_flag(:print_only_version_number) { bundler_3_mode? }
settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
settings_flag(:skip_default_git_sources) { bundler_4_mode? }
settings_flag(:specific_platform) { bundler_2_mode? }
settings_flag(:suppress_install_using_messages) { bundler_2_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_2_mode? }
settings_flag(:specific_platform) { bundler_3_mode? }
settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
settings_flag(:update_requires_all_flag) { bundler_3_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_2_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
settings_flag(:viz_command) { !bundler_3_mode? }

settings_option(:default_cli_command) { bundler_2_mode? ? :cli_help : :install }
settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }

settings_method(:github_https?, "github.https") { bundler_2_mode? }

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/rubygems_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def replace_bin_path(specs, specs_by_name)
raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable

unless spec.name == gem_name
Bundler::SharedHelpers.major_deprecation 2,
Bundler::SharedHelpers.major_deprecation 3,
"Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
"You should run `bundle binstub #{gem_name}` " \
"to work around a system/bundle conflict."
Expand Down
1 change: 1 addition & 0 deletions lib/bundler/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Settings
ignore_messages
init_gems_rb
list_command
lockfile_upgrade_warning
lockfile_uses_separate_rubygems_sources
no_install
no_prune
Expand Down
2 changes: 0 additions & 2 deletions lib/bundler/templates/newgem/Gemfile.tt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in <%= config[:name] %>.gemspec
gemspec
2 changes: 1 addition & 1 deletion lib/bundler/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Bundler
# We're doing this because we might write tests that deal
# with other versions of bundler and we are unsure how to
# handle this better.
VERSION = "2.0.0.dev" unless defined?(::Bundler::VERSION)
VERSION = "2.1.0.dev" unless defined?(::Bundler::VERSION)

def self.overwrite_loaded_gem_version
begin
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/vlad.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "bundler/shared_helpers"
Bundler::SharedHelpers.major_deprecation 2,
Bundler::SharedHelpers.major_deprecation 3,
"The Bundler task for Vlad"

# Vlad task for Bundler.
Expand Down
6 changes: 3 additions & 3 deletions spec/bundler/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

context "with no arguments" do
it "prints a concise help message", :bundler => "2" do
it "prints a concise help message", :bundler => "3" do
bundle! ""
expect(last_command.stderr).to be_empty
expect(last_command.stdout).to include("Bundler version #{Bundler::VERSION}").
Expand Down Expand Up @@ -161,12 +161,12 @@
end

RSpec.describe "bundler executable" do
it "shows the bundler version just as the `bundle` executable does", :bundler => "< 2" do
it "shows the bundler version just as the `bundle` executable does", :bundler => "< 3" do
bundler "--version"
expect(out).to eq("Bundler version #{Bundler::VERSION}")
end

it "shows the bundler version just as the `bundle` executable does", :bundler => "2" do
it "shows the bundler version just as the `bundle` executable does", :bundler => "3" do
bundler "--version"
expect(out).to eq(Bundler::VERSION)
end
Expand Down
8 changes: 4 additions & 4 deletions spec/bundler/definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
end

describe "detects changes" do
it "for a path gem with changes", :bundler => "< 2" do
it "for a path gem with changes", :bundler => "< 3" do
build_lib "foo", "1.0", :path => lib_path("foo")

install_gemfile <<-G
Expand Down Expand Up @@ -72,7 +72,7 @@
G
end

it "for a path gem with changes", :bundler => "2" do
it "for a path gem with changes", :bundler => "3" do
build_lib "foo", "1.0", :path => lib_path("foo")

install_gemfile <<-G
Expand Down Expand Up @@ -110,7 +110,7 @@
G
end

it "for a path gem with deps and no changes", :bundler => "< 2" do
it "for a path gem with deps and no changes", :bundler => "< 3" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0"
Expand Down Expand Up @@ -147,7 +147,7 @@
G
end

it "for a path gem with deps and no changes", :bundler => "2" do
it "for a path gem with deps and no changes", :bundler => "3" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", "1.0"
s.add_development_dependency "net-ssh", "1.0"
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
# gem 'spree_api'
# gem 'spree_backend'
# end
describe "#github", :bundler => "< 2" do
describe "#github", :bundler => "< 3" do
it "from github" do
spree_gems = %w[spree_core spree_api spree_backend]
subject.github "spree" do
Expand All @@ -279,7 +279,7 @@
end
end

describe "#github", :bundler => "2" do
describe "#github", :bundler => "3" do
it "from github" do
spree_gems = %w[spree_core spree_api spree_backend]
subject.github "spree" do
Expand Down

0 comments on commit e6d4f41

Please sign in to comment.