Skip to content

Commit

Permalink
allow compatibility with Ruby 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ccutrer committed Dec 21, 2023
1 parent 6948ba0 commit 24edefe
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby-version: [2.7, "3.0", 3.1, 3.2]
ruby-version: [2.6, 2.7, "3.0", 3.1, 3.2]
bundler-version: [2.4.20, 2.5.2]
exclude:
- ruby-version: 2.6
bundler-version: 2.5.2
- ruby-version: 2.7
bundler-version: 2.5.2
env:
BUNDLER_VERSION: ${{ matrix.bundler-version }}
BUNDLE_LOCKFILE: active
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/*.gem
/pkg
/.bundle/
/pkg/
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ require:
- rubocop-rake

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 2.6

Bundler/DuplicatedGem:
Enabled: false

Naming/FileName:
Exclude:
Expand Down
19 changes: 19 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,22 @@ source "https://rubygems.org"
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

plugin "bundler-multilock", path: "."
return unless Plugin.installed?("bundler-multilock")

Plugin.send(:load_plugin, "bundler-multilock")

lockfile active: RUBY_VERSION >= "2.7" do
gem "debug", "~> 1.9", require: false
gem "rubocop-inst", "~> 1.0"
gem "rubocop-rake", "~> 0.6"
gem "rubocop-rspec", "~> 2.24"
gem "stringio", "~> 3.1", require: false
end

lockfile "ruby-2.6", active: RUBY_VERSION < "2.7" do
# newer versions of these gems are not compatible with Ruby > 2.6
gem "debug", "1.8.0", require: false
gem "stringio", "3.0.6", require: false
end
21 changes: 11 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ GEM
specs:
ast (2.4.2)
base64 (0.1.1)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
debug (1.9.0)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.0)
io-console (0.6.0)
irb (1.8.1)
io-console (0.7.1)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
json (2.6.3)
Expand All @@ -23,15 +23,15 @@ GEM
parser (3.2.2.3)
ast (~> 2.4.1)
racc
psych (5.1.0)
psych (5.1.2)
stringio
racc (1.7.1)
rainbow (3.1.1)
rake (13.0.6)
rdoc (6.5.0)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.8.1)
reline (0.3.8)
reline (0.4.1)
io-console (~> 0.5)
rexml (3.2.6)
rspec (3.12.0)
Expand Down Expand Up @@ -78,7 +78,7 @@ GEM
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
stringio (3.0.8)
stringio (3.1.0)
unicode-display_width (2.4.2)

PLATFORMS
Expand All @@ -90,12 +90,13 @@ PLATFORMS

DEPENDENCIES
bundler-multilock!
debug (~> 1.8)
debug (~> 1.9)
rake (~> 13.0)
rspec (~> 3.12)
rubocop-inst (~> 1.0)
rubocop-rake (~> 0.6)
rubocop-rspec (~> 2.24)
stringio (~> 3.1)

BUNDLED WITH
2.5.2
55 changes: 55 additions & 0 deletions Gemfile.ruby-2.6.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
PATH
remote: .
specs:
bundler-multilock (1.2.1)
bundler (>= 2.4.19, < 2.6)

GEM
remote: https://rubygems.org/
specs:
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
io-console (0.7.1)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
psych (5.1.2)
stringio
rake (13.0.6)
rdoc (6.6.2)
psych (>= 4.0.0)
reline (0.4.1)
io-console (~> 0.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
stringio (3.0.6)

PLATFORMS
aarch64-linux
arm64-darwin
ruby
x86_64-darwin
x86_64-linux

DEPENDENCIES
bundler-multilock!
debug (= 1.8.0)
rake (~> 13.0)
rspec (~> 3.12)
stringio (= 3.0.6)

BUNDLED WITH
2.5.2
6 changes: 1 addition & 5 deletions bundler-multilock.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ Gem::Specification.new do |spec|
spec.files = Dir.glob("lib/**/*") + %w[plugins.rb]
spec.require_paths = ["lib"]

spec.required_ruby_version = ">= 2.7"
spec.required_ruby_version = ">= 2.6"

spec.add_dependency "bundler", ">= 2.4.19", "< 2.6"

spec.add_development_dependency "debug", "~> 1.8"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.12"
spec.add_development_dependency "rubocop-inst", "~> 1.0"
spec.add_development_dependency "rubocop-rake", "~> 0.6"
spec.add_development_dependency "rubocop-rspec", "~> 2.24"
end
2 changes: 1 addition & 1 deletion lib/bundler/multilock/ext/plugin/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module PluginExt
module DSL
::Bundler::Plugin::DSL.include(self)

def lockfile(...)
def lockfile(*, **)
# pass
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/multilock/ext/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Ext
module Source
::Bundler::Source.prepend(self)

def print_using_message(...)
def print_using_message(*)
return if Bundler.settings[:suppress_install_using_messages]

super
Expand Down

0 comments on commit 24edefe

Please sign in to comment.