Skip to content

Commit

Permalink
Add ostruct as dependency gem for Ruby 3.5 (#928)
Browse files Browse the repository at this point in the history
* Add ostruct as dependency gem for Ruby 3.5

The ostruct gem will be changed bundled gem since Ruby 3.5.0.
ruby/ruby@4db7c8a

The ostruct gem has been required at https://github.com/ohler55/oj/blob/2e57dc711172ee2aae4a1e381ad905c7d461e805/lib/oj/json.rb#L1

To use bundled gem, it requires to specify the dependency in Gemfile.

Similar with #901

* Remove unnecessary exception catch for ostruct required
  • Loading branch information
Watson1978 authored Jun 12, 2024
1 parent 2e57dc7 commit 2e6fd11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/oj/mimic.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# frozen_string_literal: false

require 'bigdecimal'
begin
require 'ostruct'
rescue Exception
# ignore
end
require 'ostruct'

module Oj

Expand Down
1 change: 1 addition & 0 deletions oj.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ['--title', 'Oj', '--main', 'README.md']

s.add_runtime_dependency 'bigdecimal', '>= 3.0'
s.add_runtime_dependency 'ostruct', '>= 0.2'
s.add_development_dependency 'minitest', '~> 5'
s.add_development_dependency 'rake-compiler', '>= 0.9', '< 2.0'
s.add_development_dependency 'test-unit', '~> 3.0'
Expand Down

0 comments on commit 2e6fd11

Please sign in to comment.