File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
3131
3232 spec . required_ruby_version = ">= 3.1.0"
3333
34+ spec . add_runtime_dependency "ice_nine" if RUBY_ENGINE != "ruby"
3435 spec . add_runtime_dependency "zeitwerk" , "~> 2.6"
3536 spec . add_runtime_dependency "dry-core" , "~> 1.1"
3637 spec . add_runtime_dependency "dry-types" , "~> 1.8" , ">= 1.8.2"
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3+ require "ice_nine" if RUBY_ENGINE != "ruby"
4+
35module Dry
46 class Struct
57 extend Core ::Deprecations [ :"dry-struct" ]
@@ -24,7 +26,16 @@ class Value < self
2426
2527 # @param (see ClassInterface#new)
2628 # @return [Value]
27- def self . new ( *) = ::Ractor . make_shareable ( super )
29+ def self . new ( *)
30+ obj = super
31+ if defined? ( ::Ractor )
32+ ::Ractor . make_shareable ( obj )
33+ elsif defined? ( ::IceNine )
34+ ::IceNine . deep_freeze ( obj )
35+ else
36+ obj . freeze
37+ end
38+ end
2839 end
2940
3041 deprecate_constant :Value
You can’t perform that action at this time.
0 commit comments