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: (39 commits)
  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
  bump bundler_2_mode in inject spec
  Version 2.0.0.pre.2 with Changelog
  fix failing major deprecation error spec
  remove :github source declaration from new gem template
  ...
  • Loading branch information
colby-swandale committed Jan 4, 2019
2 parents a63a39d + d7ad219 commit 84a5dea
Show file tree
Hide file tree
Showing 74 changed files with 396 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_from:
- .rubocop_todo.yml

AllCops:
TargetRubyVersion: 1.9
TargetRubyVersion: 2.3
Exclude:
- tmp/**/*
- lib/bundler/vendor/**/*
Expand Down
78 changes: 60 additions & 18 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-09-17 16:46:43 +0900 using RuboCop version 0.50.0.
# on 2019-01-04 16:12:29 +1100 using RuboCop version 0.50.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -13,7 +13,7 @@
Layout/IndentArray:
EnforcedStyle: consistent

# Offense count: 40
# Offense count: 46
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
Expand All @@ -29,7 +29,7 @@ Layout/MultilineMethodCallIndentation:
- 'lib/bundler/cli/common.rb'
- 'spec/bundler/plugin/source_list_spec.rb'

# Offense count: 31
# Offense count: 30
Lint/AmbiguousBlockAssociation:
Exclude:
- 'lib/bundler/definition.rb'
Expand All @@ -51,7 +51,7 @@ Lint/EmptyWhen:
- 'lib/bundler/friendly_errors.rb'
- 'spec/support/builders.rb'

# Offense count: 3
# Offense count: 4
Lint/HandleExceptions:
Exclude:
- 'lib/bundler/psyched_yaml.rb'
Expand Down Expand Up @@ -86,9 +86,17 @@ Lint/RescueException:
- 'lib/bundler/rubygems_integration.rb'
- 'lib/bundler/worker.rb'

# Offense count: 29
# Offense count: 13
Lint/RescueWithoutErrorClass:
Enabled: false
Exclude:
- 'Rakefile'
- 'lib/bundler/friendly_errors.rb'
- 'lib/bundler/resolver.rb'
- 'lib/bundler/retry.rb'
- 'lib/bundler/source/rubygems.rb'
- 'spec/support/artifice/compact_index.rb'
- 'spec/support/helpers.rb'
- 'spec/support/matchers.rb'

# Offense count: 2
Lint/ShadowedException:
Expand All @@ -102,13 +110,12 @@ Lint/UselessAccessModifier:
Exclude:
- 'lib/bundler/fetcher.rb'

# Offense count: 6
# Offense count: 1
Lint/UselessAssignment:
Exclude:
- 'lib/bundler/index.rb'
- 'lib/bundler/installer.rb'

# Offense count: 2564
# Offense count: 2856
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Expand All @@ -119,7 +126,7 @@ Naming/AccessorMethodName:
Exclude:
- 'lib/bundler/source/git.rb'

# Offense count: 31
# Offense count: 33
# Configuration parameters: Blacklist.
# Blacklist: END, (?-mix:EO[A-Z]{1})
Naming/HeredocDelimiterNaming:
Expand Down Expand Up @@ -160,7 +167,7 @@ Performance/HashEachMethods:
- 'spec/support/builders.rb'
- 'spec/support/helpers.rb'

# Offense count: 7
# Offense count: 8
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
Exclude:
Expand All @@ -183,6 +190,10 @@ Performance/RedundantMerge:
Exclude:
- 'lib/bundler/cli/gem.rb'

# Offense count: 35
Performance/UnfreezeString:
Enabled: false

# Offense count: 4
Security/Eval:
Exclude:
Expand All @@ -204,7 +215,7 @@ Style/CaseEquality:
- 'lib/bundler/match_platform.rb'
- 'lib/bundler/rubygems_ext.rb'

# Offense count: 27
# Offense count: 28
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Expand All @@ -226,7 +237,7 @@ Style/ConditionalAssignment:
- 'lib/bundler/source/git.rb'
- 'lib/bundler/source/rubygems.rb'

# Offense count: 167
# Offense count: 169
Style/Documentation:
Enabled: false

Expand All @@ -243,7 +254,7 @@ Style/EmptyMethod:
- 'lib/bundler/ui/silent.rb'
- 'spec/support/artifice/fail.rb'

# Offense count: 5
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AutoCorrectEncodingComment.
# SupportedStyles: when_needed, always, never
Expand All @@ -270,7 +281,7 @@ Style/GlobalVars:
- 'lib/bundler/cli.rb'
- 'spec/spec_helper.rb'

# Offense count: 12
# Offense count: 11
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
Expand All @@ -283,7 +294,6 @@ Style/GuardClause:
- 'lib/bundler/runtime.rb'
- 'lib/bundler/source/path/installer.rb'
- 'lib/bundler/source_list.rb'
- 'spec/commands/newgem_spec.rb'
- 'spec/support/sometimes.rb'

# Offense count: 9
Expand Down Expand Up @@ -327,14 +337,14 @@ Style/MultilineIfModifier:
- 'lib/bundler/runtime.rb'
- 'lib/bundler/source/rubygems.rb'

# Offense count: 5
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/bundler/gem_helper.rb'
- 'lib/bundler/cli/common.rb'
- 'lib/bundler/mirror.rb'
- 'lib/bundler/source/path.rb'

Expand All @@ -360,6 +370,38 @@ Style/RaiseArgs:
- 'spec/bundler/rubygems_integration_spec.rb'
- 'spec/bundler/shared_helpers_spec.rb'

# Offense count: 24
# Cop supports --auto-correct.
Style/RedundantFreeze:
Exclude:
- 'bin/bundle1'
- 'bin/bundle2'
- 'lib/bundler.rb'
- 'lib/bundler/endpoint_specification.rb'
- 'lib/bundler/environment_preserver.rb'
- 'lib/bundler/index.rb'
- 'lib/bundler/injector.rb'
- 'lib/bundler/installer.rb'
- 'lib/bundler/lockfile_generator.rb'
- 'lib/bundler/lockfile_parser.rb'
- 'lib/bundler/plugin.rb'
- 'lib/bundler/resolver/spec_group.rb'
- 'lib/bundler/source/path.rb'
- 'spec/bundler/shared_helpers_spec.rb'

# Offense count: 40
# Cop supports --auto-correct.
# Configuration parameters: ConvertCodeThatCanStartToReturnNil.
Style/SafeNavigation:
Enabled: false

# Offense count: 57
# Cop supports --auto-correct.
# Configuration parameters: MinSize, SupportedStyles.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline.
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
- rvm: 2.6.0
script: rake rubocop
stage: linting
# 3.x mode
- rvm: 2.5.3
env: RGV=v3.0.1 BUNDLER_SPEC_SUB_VERSION=3.0.0
stage: test
# Ruby 2.5, Rubygems 2.7 and up
- rvm: 2.5.3
env: RGV=v2.7.7
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## 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`

## 1.17.3 (2018-12-27)

Bugfixes:
Expand All @@ -13,6 +36,28 @@ Documentation:

- Add compatibility for bundler merge with Ruby 2.6

## 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.1 (2018-10-25)

- Convert `Pathname`s to `String`s before sorting them, fixing #6760 and #6758 ([#6761](https://github.com/bundler/bundler/pull/6761), @alexggordon)
Expand Down
2 changes: 1 addition & 1 deletion exe/bundle_ruby
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

require "bundler/shared_helpers"

Bundler::SharedHelpers.major_deprecation(2, "the bundle_ruby executable has been removed in favor of `bundle platform --ruby`")
Bundler::SharedHelpers.major_deprecation(3, "the bundle_ruby executable has been removed in favor of `bundle platform --ruby`")

Signal.trap("INT") { exit 1 }

Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -283,7 +283,7 @@ def original_env
# @deprecated Use `unbundled_env` instead
def clean_env
Bundler::SharedHelpers.major_deprecation(
2,
3,
"`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
"If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
)
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
10 changes: 5 additions & 5 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def remove(*gems)
"Include gems that are part of the specified named group."
map "i" => "install"
def install
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/install"
Bundler.settings.temporary(:no_install => false) do
Install.new(options.dup).run
Expand Down 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

0 comments on commit 84a5dea

Please sign in to comment.