Module: Bootsnap::CompileCache::YAML::Psych3
Defined Under Namespace
Modules: Patch
Instance Method Summary collapse
- #input_to_output(data, _path, kwargs) ⇒ Object
- #input_to_storage(contents, _) ⇒ Object
- #storage_to_output(data, kwargs) ⇒ Object
Instance Method Details
#input_to_output(data, _path, kwargs) ⇒ Object
339 340 341 |
# File 'lib/bootsnap/compile_cache/yaml.rb', line 339 def input_to_output(data, _path, kwargs) ::YAML.load(data, **(kwargs || {})) end |
#input_to_storage(contents, _) ⇒ Object
318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/bootsnap/compile_cache/yaml.rb', line 318 def input_to_storage(contents, _) obj = ::YAML.load(contents) packer = CompileCache::YAML.msgpack_factory.packer packer.pack(false) # not safe loaded begin packer.pack(obj) rescue NoMethodError, RangeError return UNCOMPILABLE # The object included things that we can't serialize end packer.to_s end |
#storage_to_output(data, kwargs) ⇒ Object
330 331 332 333 334 335 336 337 |
# File 'lib/bootsnap/compile_cache/yaml.rb', line 330 def storage_to_output(data, kwargs) unpacker = CompileCache::YAML.msgpack_factory.unpacker( CompileCache::YAML.(kwargs), ) unpacker.feed(data) _safe_loaded = unpacker.unpack unpacker.unpack end |