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
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.6.1/lib/active_support/core_ext/marshal.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.6.1/lib/active_support/core_ext/marshal.rb
activesupport-6.0.6.1 lib/active_support/core_ext/marshal.rb
activesupport-6.0.6 lib/active_support/core_ext/marshal.rb
activesupport-6.0.5.1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.8.1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.8 lib/active_support/core_ext/marshal.rb
activesupport-6.0.5 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.8 lib/active_support/core_ext/marshal.rb
activesupport-5.2.7.1 lib/active_support/core_ext/marshal.rb
activesupport-5.2.7 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.7 lib/active_support/core_ext/marshal.rb
activesupport-5.2.6.3 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.6 lib/active_support/core_ext/marshal.rb
activesupport-5.2.6.2 lib/active_support/core_ext/marshal.rb
activesupport-5.2.6.1 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.5 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.4 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.3 lib/active_support/core_ext/marshal.rb
activesupport-6.0.4.2 lib/active_support/core_ext/marshal.rb