Sha256: 7426dc53c4f5538280250acf417c7e65c15cd94747c352ef7c21da2fa2abc948

Contents?: true

Size: 597 Bytes

Versions: 154

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

module Bundler
  module SafeMarshal
    ALLOWED_CLASSES = [
      Array,
      FalseClass,
      Gem::Specification,
      Gem::Version,
      Hash,
      String,
      Symbol,
      Time,
      TrueClass,
    ].freeze

    ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed."

    PROC = proc do |object|
      object.tap do
        unless ALLOWED_CLASSES.include?(object.class)
          raise TypeError, format(ERROR, object.class, ALLOWED_CLASSES.join(", "))
        end
      end
    end

    def self.proc
      PROC
    end
  end
end

Version data entries

154 entries across 154 versions & 6 rubygems

Version Path
harbr-0.1.42 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/safe_marshal.rb
harbr-0.1.41 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/safe_marshal.rb
harbr-0.1.39 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/safe_marshal.rb
harbr-0.1.38 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/safe_marshal.rb
harbr-0.1.37 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/safe_marshal.rb
rubygems-update-3.5.3 bundler/lib/bundler/safe_marshal.rb
bundler-2.5.3 lib/bundler/safe_marshal.rb
rubygems-update-3.5.2 bundler/lib/bundler/safe_marshal.rb
bundler-2.5.2 lib/bundler/safe_marshal.rb
rubygems-update-3.5.1 bundler/lib/bundler/safe_marshal.rb
bundler-2.5.1 lib/bundler/safe_marshal.rb
rubygems-update-3.5.0 bundler/lib/bundler/safe_marshal.rb
bundler-2.5.0 lib/bundler/safe_marshal.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/safe_marshal.rb
rubygems-update-3.4.22 bundler/lib/bundler/safe_marshal.rb
bundler-2.4.22 lib/bundler/safe_marshal.rb
rubygems-update-3.4.21 bundler/lib/bundler/safe_marshal.rb
bundler-2.4.21 lib/bundler/safe_marshal.rb
rubygems-update-3.4.20 bundler/lib/bundler/safe_marshal.rb
bundler-2.4.20 lib/bundler/safe_marshal.rb