From f58a929d7b89b1e542381cf16c88b383cf4c39cb Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Tue, 7 Jan 2025 11:49:40 -0800 Subject: [PATCH] Vary the version of commonmarker depending on the Ruby version Ruby 3.4 is unsupported until commonmarker 2.0.2, but 2.0.2 breaks Ruby 3.3. See https://github.com/gjtorikian/commonmarker/issues/333. This change allows cocina-models dependents to use either Ruby 3.3 or 3.4. --- Gemfile.lock | 3 ++- cocina-models.gemspec | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f096e0fd..782b257e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,6 +3,7 @@ PATH specs: cocina-models (0.99.2) activesupport + commonmarker (~> 2.0, != 2.0.2) deprecation dry-struct (~> 1.0) dry-types (~> 1.1) @@ -43,7 +44,7 @@ GEM json_schema (~> 0.14, >= 0.14.3) openapi_parser (~> 1.0) rack (>= 1.5) - commonmarker (2.0.2) + commonmarker (2.0.1) rb_sys (~> 0.9) concurrent-ruby (1.3.4) connection_pool (2.4.1) diff --git a/cocina-models.gemspec b/cocina-models.gemspec index 5ba96501..7f1203f9 100644 --- a/cocina-models.gemspec +++ b/cocina-models.gemspec @@ -25,6 +25,11 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'activesupport' + if RUBY_VERSION >= '3.4' # rubocop:disable Gemspec/RubyVersionGlobalsUsage + spec.add_dependency 'commonmarker', '>= 2.0.2' # commonmarker <= 2.0.1 is incompatible with Ruby 3.4 + else + spec.add_dependency 'commonmarker', '~> 2.0', '!= 2.0.2' # commonmarker 2.0.2 includes a breaking change in Rubies < 3.4 + end spec.add_dependency 'deprecation' spec.add_dependency 'dry-struct', '~> 1.0' spec.add_dependency 'dry-types', '~> 1.1'