Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Updates #41

Merged
merged 2 commits into from
May 18, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: [2.6, 2.7, "3.0", 3.1, 3.2]
bundler-version: [2.4.19, 2.4.22, 2.5.9]
ruby-version: [2.6, 2.7, "3.0", 3.1, 3.2, 3.3]
bundler-version: [2.4.19, 2.4.22, 2.5.10]
exclude:
- ruby-version: 2.6
bundler-version: 2.5.9
bundler-version: 2.5.10
- ruby-version: 2.7
bundler-version: 2.5.9
bundler-version: 2.5.10
env:
BUNDLER_VERSION: ${{ matrix.bundler-version }}
BUNDLE_LOCKFILE: active
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ DEPENDENCIES
stringio (~> 3.1)

BUNDLED WITH
2.5.9
2.5.10
2 changes: 1 addition & 1 deletion Gemfile.ruby-2.6.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ DEPENDENCIES
stringio (= 3.0.6)

BUNDLED WITH
2.5.9
2.5.10
52 changes: 26 additions & 26 deletions lib/bundler/multilock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,13 @@ def add_lockfile(lockfile = nil,
enforce_pinned_additional_dependencies: enforce_pinned_additional_dependencies
})

if (defined?(CLI::Check) ||
defined?(CLI::Install) ||
defined?(CLI::Lock) ||
defined?(CLI::Update)) &&
!defined?(CLI::Cache) && !env_lockfile
# If they're using BUNDLE_LOCKFILE, then they really do want to
# use a particular lockfile, and it overrides whatever they
# dynamically set in their gemfile
if !env_lockfile && defined?(CLI) &&
%i[check install lock update].include?(CLI.instance&.current_command_chain&.first)
# always use Gemfile.lock for `bundle check`, `bundle install`,
# `bundle lock`, and `bundle update`. `bundle cache` delegates to
# `bundle install`, but we want that to run as normal.
# If they're using BUNDLE_LOCKFILE, then they really do want to
# use a particular lockfile, and it overrides whatever they
# dynamically set in their gemfile
# `bundle lock`, and `bundle update`.
active = lockfile == Bundler.default_lockfile(force_original: true)
end

Expand Down Expand Up @@ -577,25 +573,29 @@ def write_lockfile(lockfile_definition,
Bundler::LazySpecification.include(Bundler::MatchMetadata) if defined?(Bundler::MatchMetadata)
Bundler::Multilock.inject_preamble unless Bundler::Multilock.loaded?

# this is terrible, but we can't prepend into these modules because we only load
# _inside_ of the CLI commands already running
if defined?(Bundler::CLI::Check)
require_relative "multilock/check"
at_exit do
next unless $!.nil?
next if $!.is_a?(SystemExit) && !$!.success?
if defined?(Bundler::CLI)
require_relative "multilock/ext/cli"

next if Bundler::Multilock::Check.run
# this is terrible, but we can't prepend into these modules because we only load
# _inside_ of the CLI commands already running
if Bundler::CLI.instance&.current_command_chain&.first == :check
require_relative "multilock/check"
at_exit do
next unless $!.nil?
next if $!.is_a?(SystemExit) && !$!.success?

Bundler.ui.warn("You can attempt to fix by running `bundle install`")
exit 1
next if Bundler::Multilock::Check.run

Bundler.ui.warn("You can attempt to fix by running `bundle install`")
exit 1
end
end
end
if defined?(Bundler::CLI::Lock)
at_exit do
next unless $!.nil?
next if $!.is_a?(SystemExit) && !$!.success?
if Bundler::CLI.instance&.current_command_chain&.first == :lock
at_exit do
next unless $!.nil?
next if $!.is_a?(SystemExit) && !$!.success?

Bundler::Multilock.after_install_all(install: false)
Bundler::Multilock.after_install_all(install: false)
end
end
end
20 changes: 20 additions & 0 deletions lib/bundler/multilock/ext/cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Bundler
module Multilock
module Ext
module CLI
module ClassMethods
def instance
return @instance if instance_variable_defined?(:@instance)

# this is a little icky, but there's no other way to determine which command was run
@instance = ObjectSpace.each_object(::Bundler::CLI).first
end
end

::Bundler::CLI.extend(ClassMethods)
end
end
end
end
Loading