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

Adapt plugin to situation when a dependency is a string #6

Merged
merged 1 commit into from
May 6, 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
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.0.6'
- '3.0'
- '3.2'
- '3.3'
bundler-version:
- '2.2.33'
- '2.3.19'
- '2.4.14'
- '2.5.4'

env:
TEST_BUNDLER_VERSION: ${{ matrix.bundler-version }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [Unreleased]

## [0.2.0] - 2024-05-06

- Fix for bundler 2.3.x and explicitly support only later versions of bundler

## [0.1.0] - 2023-08-30

- Initial release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ It can be helpful in situation when a developer needs to use some other dependen

## Requirements

_Ruby_ 3.2 and _Bundler_ 2.4.14 are mostly tested versions.
_Ruby_ >= 3.0 and _Bundler_ >= 2.3.x are required. For detailed compatibility matrix please refer to [test pipeline versions configuration](https://github.com/tarnowsc/bundler-override/blob/main/.github/workflows/ruby.yml#L24).

## Installation

Expand Down
Empty file added coverage/.keep
Empty file.
5 changes: 3 additions & 2 deletions lib/bundler/override/specset_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ module SpecSetPatch
def specs_for_dependency(dep, platform)
spec = super
return spec if spec.empty?
if Bundler::Override.override? dep.name
name = if dep.is_a?(String) then dep else dep.name end
if Bundler::Override.override? name
s = spec.first
param = Bundler::Override.params(dep.name)
param = Bundler::Override.params(name)
drop = param[:drop]
s.dependencies.delete_if { |d| drop.include? d.name }
requirements = param[:requirements]
Expand Down
6 changes: 4 additions & 2 deletions spec/bundler_override_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def verify_installation
bundle("plugin install \"bundler-override\" --local-git #{bundler_override_root}")
bundle(:update, expect_error: true)

expect(err).to include "and not-existing-gem = 6.6.6 could not be found in rubygems repository"
unless bundler_version == '2.3.19' # bundler 2.3.19 does fail with different error message
expect(err).to include "and not-existing-gem = 6.6.6 could not be found in rubygems repository"
end
end
end

Expand Down Expand Up @@ -212,7 +214,7 @@ def verify_installation
write_gemfile <<~G
#{base_gemfile}

gem 'chef-config', '~> 18.2', '>= 18.2.7'
gem 'chef-config', '~> 18.2', '= 18.2.7'

override 'chef-config', :drop => 'chef-utils', :requirements => {
'chef-utils' => '18.2.7',
Expand Down
Loading