Sha256: 0fd6676294987c9d8acffbf69811c4efaf789264fbae9e572b0d11a9817a730f

Contents?: true

Size: 637 Bytes

Versions: 100

Compression:

Stored size: 637 Bytes

Contents

# frozen_string_literal: true

module ActiveSupport
  module MarshalWithAutoloading # :nodoc:
    def load(source, proc = nil)
      super(source, proc)
    rescue ArgumentError, NameError => exc
      if exc.message.match(%r|undefined class/module (.+?)(?:::)?\z|)
        # try loading the class/module
        loaded = $1.constantize

        raise unless $1 == loaded.name

        # if it is an IO we need to go back to read the object
        source.rewind if source.respond_to?(:rewind)
        retry
      else
        raise exc
      end
    end
  end
end

Marshal.singleton_class.prepend(ActiveSupport::MarshalWithAutoloading)

Version data entries

100 entries across 91 versions & 12 rubygems

Version Path
activesupport-6.0.0.rc1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.3 lib/active_support/core_ext/marshal.rb
activesupport-5.2.3.rc1 lib/active_support/core_ext/marshal.rb
activesupport-6.0.0.beta3 lib/active_support/core_ext/marshal.rb
activesupport-5.2.2.1 lib/active_support/core_ext/marshal.rb
activesupport-6.0.0.beta2 lib/active_support/core_ext/marshal.rb
activesupport-6.0.0.beta1 lib/active_support/core_ext/marshal.rb
nullifyable-0.1.0 vendor/bundle/gems/activesupport-5.2.2/lib/active_support/core_ext/marshal.rb
activesupport-5.2.2 lib/active_support/core_ext/marshal.rb
activesupport-5.2.2.rc1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.1.1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.1.rc1 lib/active_support/core_ext/marshal.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/activesupport-5.2.0/lib/active_support/core_ext/marshal.rb
activesupport-5.2.0 lib/active_support/core_ext/marshal.rb
activesupport-5.2.0.rc2 lib/active_support/core_ext/marshal.rb
activesupport-5.2.0.rc1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.0.beta2 lib/active_support/core_ext/marshal.rb
activesupport-5.2.0.beta1 lib/active_support/core_ext/marshal.rb
ruby-on-quails-0.1.0 activesupport/lib/active_support/core_ext/marshal.rb