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

Get ready for 2.1.0 release #7479

Merged
31 commits merged into from Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .rspec_parallel
@@ -1,3 +1,4 @@
--format progress
--format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log
--require spec_helper
--require support/parallel.rb
48 changes: 24 additions & 24 deletions .rubocop.yml
Expand Up @@ -55,7 +55,7 @@ Lint/DuplicateCaseCondition:
Lint/DuplicateMethods:
Enabled: true

Lint/DuplicatedKey:
Lint/DuplicateHashKey:
Enabled: true

Lint/EachWithObjectArgument:
Expand Down Expand Up @@ -106,7 +106,7 @@ Lint/LiteralInInterpolation:
Lint/Loop:
Enabled: true

Lint/MultipleCompare:
Lint/MultipleComparison:
Enabled: true

Lint/NestedPercentLiteral:
Expand Down Expand Up @@ -171,7 +171,7 @@ Lint/ShadowedArgument:
Lint/ShadowingOuterLocalVariable:
Enabled: true

Lint/StringConversionInInterpolation:
Lint/RedundantStringCoercion:
Enabled: true

Lint/Syntax:
Expand All @@ -183,15 +183,6 @@ Lint/UnderscorePrefixedVariableName:
Lint/UnifiedInteger:
Enabled: true

Lint/UnneededCopDisableDirective:
Enabled: true

Lint/UnneededCopEnableDirective:
Enabled: true

Lint/UnneededSplatExpansion:
Enabled: true

Lint/UnreachableCode:
Enabled: true

Expand Down Expand Up @@ -222,10 +213,10 @@ Layout/AccessModifierIndentation:
Enabled: true
EnforcedStyle: outdent

Layout/AlignArray:
Layout/ArrayAlignment:
Enabled: true

Layout/AlignParameters:
Layout/ParameterAlignment:
Enabled: true
EnforcedStyle: with_fixed_indentation

Expand Down Expand Up @@ -301,18 +292,18 @@ Layout/EndOfLine:
Layout/ExtraSpacing:
Enabled: true

Layout/IndentAssignment:
Layout/AssignmentIndentation:
Enabled: true

Layout/IndentFirstArrayElement:
Layout/FirstArrayElementIndentation:
Enabled: true
EnforcedStyle: consistent

Layout/IndentFirstHashElement:
Layout/FirstHashElementIndentation:
Enabled: true
EnforcedStyle: special_inside_parentheses

Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true

Layout/IndentationConsistency:
Expand All @@ -324,7 +315,7 @@ Layout/IndentationWidth:
Layout/InitialIndentation:
Enabled: true

Layout/LeadingBlankLines:
Layout/LeadingEmptyLines:
Enabled: true

Layout/LeadingCommentSpace:
Expand Down Expand Up @@ -395,7 +386,7 @@ Layout/SpaceInsideStringInterpolation:
Layout/Tab:
Enabled: true

Layout/TrailingBlankLines:
Layout/TrailingEmptyLines:
Enabled: true

Layout/TrailingWhitespace:
Expand Down Expand Up @@ -424,7 +415,7 @@ Naming/HeredocDelimiterCase:
Naming/MethodName:
Enabled: true

Naming/UncommunicativeBlockParamName:
Naming/BlockParameterName:
Enabled: true

Naming/VariableName:
Expand Down Expand Up @@ -705,9 +696,18 @@ Style/RedundantBegin:
Style/RedundantConditional:
Enabled: true

Lint/RedundantCopDisableDirective:
Enabled: true

Lint/RedundantCopEnableDirective:
Enabled: true

Style/RedundantException:
Enabled: true

Style/RedundantInterpolation:
Enabled: true

Style/RedundantParentheses:
Enabled: true

Expand All @@ -717,6 +717,9 @@ Style/RedundantSelf:
Style/RedundantSortBy:
Enabled: true

Lint/RedundantSplatExpansion:
Enabled: true

Style/RegexpLiteral:
Enabled: true

Expand Down Expand Up @@ -798,9 +801,6 @@ Style/TrailingCommaInHashLiteral:
Style/TrailingMethodEndStatement:
Enabled: true

Style/UnneededInterpolation:
Enabled: true

Style/UnlessElse:
Enabled: true

Expand Down
30 changes: 27 additions & 3 deletions CHANGELOG.md
@@ -1,3 +1,27 @@
## 2.1.0 (December 15, 2019)

Features:

- Add support for new default gems. In particular,

* `open3` [#7455](https://github.com/bundler/bundler/pull/7455)
* `cgi`: [#7456](https://github.com/bundler/bundler/pull/7456)
* `uri` [#7460](https://github.com/bundler/bundler/pull/7460)

plus other PRs removing or lazily loading usages of these gems from other places to not interfere with user's choice, such as [#7471](https://github.com/bundler/bundler/pull/7471) or [#7473](https://github.com/bundler/bundler/pull/7473)

Bugfixes:

- Fix `bundle exec rake install` failing [#7474](https://github.com/bundler/bundler/pull/7474)
- Fix `bundle exec`'ing to rubygems being silent [#7442](https://github.com/bundler/bundler/pull/7442)
- Restore previous `BUNDLE_GEMFILE` in `bundler/inline` [#7418](https://github.com/bundler/bundler/pull/7418)
- Fix error when using `gem` DSL's `:glob` option for selecting gemspecs from a specific source [#7419](https://github.com/bundler/bundler/pull/7419)

Changes:

- `bundle config` no longer warns when using "old interface" (might be deprecated again in the future) [#7475](https://github.com/bundler/bundler/pull/7475)
- `bundle update` no longer warns when used without arguments (might be deprecated again in the future) [#7475](https://github.com/bundler/bundler/pull/7475)

## 2.1.0.pre.3 (November 12, 2019)

Features:
Expand All @@ -20,13 +44,13 @@ Bugfixes:
Bugfixes:

- Fix `bundle clean` trying to delete non-existent directory ([#7340](https://github.com/bundler/bundler/pull/7340))
- Fix warnings about keywork argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))
- Fix warnings about keyword argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))

## 2.1.0.pre.1 (August 28, 2019)

One of the biggest changes in bundler 2.1.0 is that deprecations for upcoming
breaking changes in bundler 3 will be turned on by default. We do this to grab
feedback and comunicate early to our users the kind of changes we're intending
feedback and communicate early to our users the kind of changes we're intending
to ship with bundler 3. See
[#6965](https://github.com/bundler/bundler/pull/6965).

Expand Down Expand Up @@ -89,7 +113,7 @@ Bugfixes:
- Warn about situations where multiple gems provide the same executable ([#7075](https://github.com/bundler/bundler/pull/7075))
- Ignore `frozen` setting in inline mode ([#7125](https://github.com/bundler/bundler/pull/7125))
- Fix incorrect "bundler attempted to update GEM but version stayed the same" message when updating git sourced gems ([#6325](https://github.com/bundler/bundler/pull/6325))
- Don't check for existance of a writable home directory if `BUNDLE_USER_HOME` is set ([#6885](https://github.com/bundler/bundler/pull/6885))
- Don't check for existence of a writable home directory if `BUNDLE_USER_HOME` is set ([#6885](https://github.com/bundler/bundler/pull/6885))
- Fix error message when server would respond to a bad username/password requiest with a 401 ([#6928](https://github.com/bundler/bundler/pull/6928))
- Fix `bundle outdated` pluralization when multiple groups are requested ([#7063](https://github.com/bundler/bundler/pull/7063))
- Fix `bundle install` not updating conservatively when gemspec is changed ([#7143](https://github.com/bundler/bundler/pull/7143))
Expand Down
36 changes: 17 additions & 19 deletions Rakefile
Expand Up @@ -222,9 +222,6 @@ rescue Gem::LoadError => e

desc "Vendor a specific version of net-http-persistent"
task(:"net-http-persistent") { abort msg }

desc "Vendor a specific version of connection_pool"
task(:connection_pool) { abort msg }
end
else
desc "Vendor a specific version of molinillo"
Expand Down Expand Up @@ -254,30 +251,31 @@ else
lib.vendor_lib = "lib/bundler/vendor/fileutils"
end

# Currently `net-http-persistent` and it's dependency `connection_pool` are
# vendored separately, but `connection_pool` references inside the vendored
# copy of `net-http-persistent` are not properly updated to refer to the
# vendored copy of `connection_pool`, so they need to be manually updated.
# This will be automated once https://github.com/segiddins/automatiek/pull/3
# is included in `automatiek` and we start using the new API for vendoring
# subdependencies.
# Besides that, we currently cherry-pick changes to use `require_relative`
# internally instead of regular `require`. They are pending review at
# We currently cherry-pick changes to use `require_relative` internally
# instead of regular `require`. They are pending review at
# https://github.com/drbrain/net-http-persistent/pull/106
desc "Vendor a specific version of net-http-persistent"
Automatiek::RakeTask.new("net-http-persistent") do |lib|
lib.download = { :github => "https://github.com/drbrain/net-http-persistent" }
lib.namespace = "Net::HTTP::Persistent"
lib.prefix = "Bundler::Persistent"
lib.vendor_lib = "lib/bundler/vendor/net-http-persistent"
end

desc "Vendor a specific version of connection_pool"
Automatiek::RakeTask.new("connection_pool") do |lib|
lib.download = { :github => "https://github.com/mperham/connection_pool" }
lib.namespace = "ConnectionPool"
lib.prefix = "Bundler"
lib.vendor_lib = "lib/bundler/vendor/connection_pool"
lib.dependency("connection_pool") do |sublib|
sublib.version = "v2.2.2"
sublib.download = { :github => "https://github.com/mperham/connection_pool" }
sublib.namespace = "ConnectionPool"
sublib.prefix = "Bundler"
sublib.vendor_lib = "lib/bundler/vendor/connection_pool"
end

lib.dependency("uri") do |sublib|
sublib.version = "master"
sublib.download = { :github => "https://github.com/ruby/uri" }
sublib.namespace = "URI"
sublib.prefix = "Bundler"
sublib.vendor_lib = "lib/bundler/vendor/uri"
end
end
end

Expand Down
9 changes: 9 additions & 0 deletions azure-pipelines.yml
@@ -1,3 +1,12 @@
trigger:
branches:
include:
- master
- staging
- trying
- /.+-dev$/
- /.+-stable$/

jobs:
- job: Windows
pool:
Expand Down
6 changes: 5 additions & 1 deletion doc/development/SETUP.md
Expand Up @@ -24,7 +24,11 @@ Bundler doesn't use a Gemfile to list development dependencies, because when we

$ bin/rake spec

6. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias ([follow these instructions](https://www.moncefbelyamani.com/create-aliases-in-bash-profile-to-assign-shortcuts-for-common-terminal-commands/) for adding aliases to your `~/.bashrc` profile):
6. Optionally, you can run the test suite in parallel:

$ bin/parallel_rspec spec

7. Set up a shell alias to run Bundler from your clone, e.g. a Bash alias ([follow these instructions](https://www.moncefbelyamani.com/create-aliases-in-bash-profile-to-assign-shortcuts-for-common-terminal-commands/) for adding aliases to your `~/.bashrc` profile):

$ alias dbundle='/path/to/bundler/repo/bin/bundle'

Expand Down
1 change: 0 additions & 1 deletion lib/bundler.rb
Expand Up @@ -50,7 +50,6 @@ module Bundler
autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
autoload :GemRemoteFetcher, File.expand_path("bundler/gem_remote_fetcher", __dir__)
autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
autoload :Graph, File.expand_path("bundler/graph", __dir__)
autoload :Index, File.expand_path("bundler/index", __dir__)
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli.rb
Expand Up @@ -783,7 +783,7 @@ def warn_on_outdated_bundler
return unless SharedHelpers.md5_available?

latest = Fetcher::CompactIndex.
new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
send(:compact_index_client).
instance_variable_get(:@cache).
dependencies("bundler").
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli/config.rb
Expand Up @@ -25,7 +25,7 @@ def base(name = nil, *value)
["config", "get", ARGV[1]]
end

SharedHelpers.major_deprecation 2,
SharedHelpers.major_deprecation 3,
"Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."

Base.new(options, name, value, self).run
Expand Down
15 changes: 12 additions & 3 deletions lib/bundler/cli/exec.rb
Expand Up @@ -25,12 +25,12 @@ def run
SharedHelpers.set_bundle_environment
if bin_path = Bundler.which(cmd)
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
return kernel_load(bin_path, *args)
return with_verbose_rubygems { kernel_load(bin_path, *args) }
end
kernel_exec(bin_path, *args)
with_verbose_rubygems { kernel_exec(bin_path, *args) }
else
# exec using the given command
kernel_exec(cmd, *args)
with_verbose_rubygems { kernel_exec(cmd, *args) }
end
end

Expand Down Expand Up @@ -89,5 +89,14 @@ def ruby_shebang?(file)
first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
possibilities.any? {|shebang| first_line.start_with?(shebang) }
end

def with_verbose_rubygems
old_ui = Gem::DefaultUserInteraction.ui
Gem::DefaultUserInteraction.ui = nil

yield
ensure
Gem::DefaultUserInteraction.ui = old_ui
end
end
end
2 changes: 1 addition & 1 deletion lib/bundler/cli/update.rb
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/feature_flag.rb
Expand Up @@ -46,7 +46,7 @@ def self.settings_method(name, key, &default)
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(:update_requires_all_flag) { bundler_4_mode? }
settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }

settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/fetcher.rb
Expand Up @@ -97,7 +97,7 @@ def fetch_spec(spec)
spec -= [nil, "ruby", ""]
spec_file_name = "#{spec.join "-"}.gemspec"

uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
if uri.scheme == "file"
path = Bundler.rubygems.correct_for_windows_path(uri.path)
Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
Expand Down Expand Up @@ -244,7 +244,7 @@ def connection

con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
con.proxy = URI.parse(gem_proxy) if gem_proxy != :no_proxy
con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
end

if remote_uri.scheme == "https"
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/fetcher/downloader.rb
Expand Up @@ -21,7 +21,7 @@ def fetch(uri, headers = {}, counter = 0)
when Net::HTTPSuccess, Net::HTTPNotModified
response
when Net::HTTPRedirection
new_uri = URI.parse(response["location"])
new_uri = Bundler::URI.parse(response["location"])
if new_uri.host == uri.host
new_uri.user = uri.user
new_uri.password = uri.password
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/fetcher/index.rb
Expand Up @@ -28,7 +28,7 @@ def fetch_spec(spec)
spec -= [nil, "ruby", ""]
spec_file_name = "#{spec.join "-"}.gemspec"

uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
if uri.scheme == "file"
path = Bundler.rubygems.correct_for_windows_path(uri.path)
Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
Expand Down