Sha256: 67e875f85ce6d5c517c820101dfdf22230f45cb15f6d5efc7f74fc5554c2743c

Contents?: true

Size: 606 Bytes

Versions: 51

Compression:

Stored size: 606 Bytes

Contents

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

51 entries across 49 versions & 6 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/marshal.rb
activesupport-5.1.7 lib/active_support/core_ext/marshal.rb
activesupport-5.1.7.rc1 lib/active_support/core_ext/marshal.rb
activesupport-5.1.6.2 lib/active_support/core_ext/marshal.rb
activesupport-5.0.7.2 lib/active_support/core_ext/marshal.rb
activesupport-5.1.6.1 lib/active_support/core_ext/marshal.rb
activesupport-5.0.7.1 lib/active_support/core_ext/marshal.rb
activesupport-5.1.6 lib/active_support/core_ext/marshal.rb
activesupport-5.0.7 lib/active_support/core_ext/marshal.rb
tdiary-5.0.8 vendor/bundle/gems/activesupport-5.1.5/lib/active_support/core_ext/marshal.rb
activesupport-5.1.5 lib/active_support/core_ext/marshal.rb
activesupport-5.1.5.rc1 lib/active_support/core_ext/marshal.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/core_ext/marshal.rb
activesupport-5.1.4 lib/active_support/core_ext/marshal.rb
activesupport-5.0.6 lib/active_support/core_ext/marshal.rb
activesupport-5.1.4.rc1 lib/active_support/core_ext/marshal.rb
activesupport-5.0.6.rc1 lib/active_support/core_ext/marshal.rb
activesupport-5.1.3 lib/active_support/core_ext/marshal.rb
activesupport-5.1.3.rc3 lib/active_support/core_ext/marshal.rb
activesupport-5.0.5 lib/active_support/core_ext/marshal.rb