Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@ AC_ARG_WITH(git,
{
test x"$HAVE_GIT" = xyes &&
command -v "$GIT" > /dev/null &&
# `git -C`: 1.8.5
# `git log --no-show-signature`: 2.10.0
# see Dependencies in doc/contributing/building_ruby.md
AS_CASE([`$GIT -C . --version 2> /dev/null | sed 's/.* //'`],
[0.*|1.*|2.@<:@0-9@:>@.*], [false],
[0.*|1.*|2.@<:@0-9@:>@.*|2.@<:@12@:>@@<:@0-9@:>@.*|2.3@<:@01@:>@.*], [false],
[true])
} || HAVE_GIT=no GIT=never-use
AC_SUBST(GIT)
Expand Down
12 changes: 8 additions & 4 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,11 @@ def check
long_desc <<-D
Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
D
method_option "install", type: :boolean, banner: "Runs 'bundle install' after removing the gems from the Gemfile"
method_option "install", type: :boolean, banner: "Runs 'bundle install' after removing the gems from the Gemfile (removed)"
def remove(*gems)
if ARGV.include?("--install")
message = "The `--install` flag has been deprecated. `bundle install` is triggered by default."
removed_message = "The `--install` flag has been removed. `bundle install` is triggered by default."
SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
raise InvalidOption, removed_message
end

require_relative "cli/remove"
Expand All @@ -210,7 +209,7 @@ def remove(*gems)

If the bundle has already been installed, bundler will tell you so and then exit.
D
method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin"
method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin (removed)"
method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install (removed)"
method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments (removed)"
method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install (removed)"
Expand Down Expand Up @@ -240,6 +239,11 @@ def install

remembered_flag_deprecation("deployment", negative: true)

if ARGV.include?("--binstubs")
removed_message = "The --binstubs option has been removed in favor of `bundle binstubs --all`"
raise InvalidOption, removed_message
end

require_relative "cli/install"
Bundler.settings.temporary(no_install: false) do
Install.new(options.dup).run
Expand Down
6 changes: 0 additions & 6 deletions lib/bundler/cli/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ def run

Bundler::Fetcher.disable_endpoint = options["full-index"]

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

Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?

# For install we want to enable strict validation
Expand Down
5 changes: 0 additions & 5 deletions lib/bundler/man/bundle-install.1
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ If a \fBGemfile\.lock\fR does exist, and you have not updated your Gemfile(5), B
If a \fBGemfile\.lock\fR does exist, and you have updated your Gemfile(5), Bundler will use the dependencies in the \fBGemfile\.lock\fR for all gems that you did not update, but will re\-resolve the dependencies of gems that you did update\. You can find more information about this update process below under \fICONSERVATIVE UPDATING\fR\.
.SH "OPTIONS"
.TP
\fB\-\-binstubs[=BINSTUBS]\fR
Binstubs are scripts that wrap around executables\. Bundler creates a small Ruby file (a binstub) that loads Bundler, runs the command, and puts it in \fBbin/\fR\. This lets you link the binstub inside of an application to the exact gem version the application needs\.
.IP
Creates a directory (defaults to \fB~/bin\fR when the option is used without a value, or to the given \fB<BINSTUBS>\fR directory otherwise) and places any executables from the gem there\. These executables run in Bundler's context\. If used, you might add this directory to your environment's \fBPATH\fR variable\. For instance, if the \fBrails\fR gem comes with a \fBrails\fR executable, this flag will create a \fBbin/rails\fR executable that ensures that all referred dependencies will be resolved using the bundled gems\.
.TP
\fB\-\-force\fR, \fB\-\-redownload\fR
Force reinstalling every gem, even if already installed\.
.TP
Expand Down
14 changes: 0 additions & 14 deletions lib/bundler/man/bundle-install.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ update process below under [CONSERVATIVE UPDATING][].

## OPTIONS

* `--binstubs[=BINSTUBS]`:
Binstubs are scripts that wrap around executables. Bundler creates a small Ruby
file (a binstub) that loads Bundler, runs the command, and puts it in `bin/`.
This lets you link the binstub inside of an application to the exact gem
version the application needs.

Creates a directory (defaults to `~/bin` when the option is used without a
value, or to the given `<BINSTUBS>` directory otherwise) and places any
executables from the gem there. These executables run in Bundler's context. If
used, you might add this directory to your environment's `PATH` variable. For
instance, if the `rails` gem comes with a `rails` executable, this flag will
create a `bin/rails` executable that ensures that all referred dependencies
will be resolved using the bundled gems.

* `--force`, `--redownload`:
Force reinstalling every gem, even if already installed.

Expand Down
8 changes: 1 addition & 7 deletions lib/bundler/man/bundle-remove.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@
.SH "NAME"
\fBbundle\-remove\fR \- Removes gems from the Gemfile
.SH "SYNOPSIS"
\fBbundle remove [GEM [GEM \|\.\|\.\|\.]] [\-\-install]\fR
`bundle remove [GEM [GEM \|\.\|\.\|\.]]
.SH "DESCRIPTION"
Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid\. If a gem cannot be removed, a warning is printed\. If a gem is already absent from the Gemfile, and error is raised\.
.SH "OPTIONS"
.TP
\fB\-\-install\fR
Runs \fBbundle install\fR after the given gems have been removed from the Gemfile, which ensures that both the lockfile and the installed gems on disk are also updated to remove the given gem(s)\.
.P
Example:
.P
bundle remove rails
.P
bundle remove rails rack
.P
bundle remove rails rack \-\-install
9 changes: 1 addition & 8 deletions lib/bundler/man/bundle-remove.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ bundle-remove(1) -- Removes gems from the Gemfile

## SYNOPSIS

`bundle remove [GEM [GEM ...]] [--install]`
`bundle remove [GEM [GEM ...]]

## DESCRIPTION

Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If a gem cannot be removed, a warning is printed. If a gem is already absent from the Gemfile, and error is raised.

## OPTIONS

* `--install`:
Runs `bundle install` after the given gems have been removed from the Gemfile, which ensures that both the lockfile and the installed gems on disk are also updated to remove the given gem(s).

Example:

bundle remove rails

bundle remove rails rack

bundle remove rails rack --install
2 changes: 0 additions & 2 deletions lib/rubygems/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,6 @@ def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
symlinks << [full_name, link_target, destination, real_destination]
end

FileUtils.rm_rf destination

mkdir =
if entry.directory?
destination
Expand Down
15 changes: 0 additions & 15 deletions spec/bundler/commands/remove_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@
end
end

context "when --install flag is specified" do
it "removes gems from .bundle" do
gemfile <<-G
source "https://gem.repo1"

gem "myrack"
G

bundle "remove myrack --install"

expect(out).to include("myrack was removed.")
expect(the_bundle).to_not include_gems "myrack"
end
end

describe "remove single gem from gemfile" do
context "when gem is present in gemfile" do
it "shows success for removed gem" do
Expand Down
16 changes: 6 additions & 10 deletions spec/bundler/other/major_deprecation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -398,17 +398,15 @@

describe "bundle install --binstubs" do
before do
install_gemfile <<-G, binstubs: true
install_gemfile <<-G, binstubs: true, raise_on_error: false
source "https://gem.repo1"
gem "myrack"
G
end

it "should output a deprecation warning" do
expect(deprecations).to include("The --binstubs option will be removed in favor of `bundle binstubs --all`")
it "fails with a helpful error" do
expect(err).to include("The --binstubs option has been removed in favor of `bundle binstubs --all`")
end

pending "fails with a helpful error", bundler: "4"
end

context "bundle install with both gems.rb and Gemfile present" do
Expand Down Expand Up @@ -669,13 +667,11 @@
end

context "with --install" do
it "shows a deprecation warning" do
bundle "remove myrack --install"
it "fails with a helpful message" do
bundle "remove myrack --install", raise_on_error: false

expect(err).to include "[DEPRECATED] The `--install` flag has been deprecated. `bundle install` is triggered by default."
expect(err).to include "The `--install` flag has been removed. `bundle install` is triggered by default."
end

pending "fails with a helpful message", bundler: "4"
end
end

Expand Down
2 changes: 0 additions & 2 deletions test/json/json_generic_object_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ def setup
else
omit("JSON::GenericObject is not available")
end
rescue NameError
omit("JSON::GenericObject is not available")
end

def test_attributes
Expand Down
9 changes: 4 additions & 5 deletions tool/sync_default_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -455,17 +455,16 @@ def message_filter(repo, sha, input: ARGF)
end

def log_format(format, args, &block)
IO.popen(%W[git log --no-show-signature --format=#{format}] + args, "rb", &block)
IO.popen(%W[git -c core.autocrlf=false -c core.eol=lf
log --no-show-signature --format=#{format}] + args, "rb", &block)
end

# Returns commit list as array of [commit_hash, subject].
def commits_in_ranges(gem, repo, default_branch, ranges)
# If -a is given, discover all commits since the last picked commit
if ranges == true
# \r? needed in the regex in case the commit has windows-style line endings (because e.g. we're running
# tests on Windows)
pattern = "https://github\.com/#{Regexp.quote(repo)}/commit/([0-9a-f]+)\r?$"
log = log_format('%B', %W"-E --grep=#{pattern} -n1", &:read)
pattern = "https://github\.com/#{Regexp.quote(repo)}/commit/([0-9a-f]+)$"
log = log_format('%B', %W"-E --grep=#{pattern} -n1 --", &:read)
ranges = ["#{log[%r[#{pattern}\n\s*(?i:co-authored-by:.*)*\s*\Z], 1]}..#{gem}/#{default_branch}"]
end

Expand Down
5 changes: 3 additions & 2 deletions tool/test/test_sync_default_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def setup
# Generate a new unprotected key with default parameters that
# expires after 30 seconds.
if @gpgsign = system(*%w"gpg --quiet --batch --passphrase", "",
"--quick-generate-key", email, *%W"default default seconds=#{expire}")
"--quick-generate-key", email, *%W"default default seconds=#{expire}",
err: IO::NULL)
# Fetch the generated public key.
signingkey = IO.popen(%W"gpg --quiet --list-public-key #{email}", &:read)[/^pub .*\n +\K\h+/]
end
Expand Down Expand Up @@ -313,5 +314,5 @@ def test_delete_after_conflict
assert_equal(":ok\n""Should.be_merged\n", File.read("src/lib/common.rb"), out)
assert_not_operator(File, :exist?, "src/lib/bad.rb", out)
end
end
end if /darwin|linux/ =~ RUBY_PLATFORM
end
3 changes: 2 additions & 1 deletion win32/Makefile.sub
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ HAVE_GIT = no
!if "$(HAVE_GIT)" == "no"
!else if [for /f "tokens=3" %I in ('git --version') do @(\
for /f "delims=. tokens=1-2" %I in ("%I") do @(\
if %I lss 2 (exit 1) else if %J lss 10 (exit 1) else (exit 0)\
if %I lss 2 (exit 1) else if %I gtr 2 (exit 0) \
else if %J lss 32 (exit 1) else (exit 0)\
)\
)]
HAVE_GIT = no
Expand Down