From ce6810ebaa499cdd7419807cbda7eb867778eea7 Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Tue, 7 Jan 2025 11:21:57 -0800 Subject: [PATCH 1/2] Unpin and bump commonmarker --- Gemfile.lock | 3 +-- cocina-models.gemspec | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index fdf7d10f..f096e0fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,6 @@ PATH specs: cocina-models (0.99.2) activesupport - commonmarker (= 2.0.1) deprecation dry-struct (~> 1.0) dry-types (~> 1.1) @@ -44,7 +43,7 @@ GEM json_schema (~> 0.14, >= 0.14.3) openapi_parser (~> 1.0) rack (>= 1.5) - commonmarker (2.0.1) + commonmarker (2.0.2) 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 229250ff..5ba96501 100644 --- a/cocina-models.gemspec +++ b/cocina-models.gemspec @@ -25,7 +25,6 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.0' spec.add_dependency 'activesupport' - spec.add_dependency 'commonmarker', '2.0.1' # There is a breaking change in 2.0.2 with openapi3_parser spec.add_dependency 'deprecation' spec.add_dependency 'dry-struct', '~> 1.0' spec.add_dependency 'dry-types', '~> 1.1' From f58a929d7b89b1e542381cf16c88b383cf4c39cb Mon Sep 17 00:00:00 2001 From: "Michael J. Giarlo" Date: Tue, 7 Jan 2025 11:49:40 -0800 Subject: [PATCH 2/2] 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'