Files
news.gitea.happylizard.me/bin/gems/bundler-4.0.21/lib/bundler/safe_marshal.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

32 lines
597 B
Ruby

# 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