Skip to content

Commit

Permalink
Vary the version of commonmarker depending on the Ruby version
Browse files Browse the repository at this point in the history
Ruby 3.4 is unsupported until commonmarker 2.0.2, but 2.0.2 breaks Ruby 3.3. See gjtorikian/commonmarker#333. This change allows cocina-models dependents to use either Ruby 3.3 or 3.4.
  • Loading branch information
mjgiarlo committed Jan 7, 2025
1 parent ce6810e commit fd3802d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions cocina-models.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 3.0'

spec.add_dependency 'activesupport'
if RUBY_VERSION >= '3.4'
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'
Expand Down

0 comments on commit fd3802d

Please sign in to comment.