module Vernacular::BootsnapMixin

Module that gets included into `Bootsnap::CompileCache::ISeq` in order to hook into the bootsnap compilation process.

Public Instance Methods

input_to_storage(contents, filepath) click to toggle source
# File lib/vernacular.rb, line 30
def input_to_storage(contents, filepath)
  contents = ::Vernacular.modify(contents)
  iseq = RubyVM::InstructionSequence.compile(contents, filepath, filepath)
  iseq.to_binary
rescue SyntaxError
  raise ::Bootsnap::CompileCache::Uncompilable, 'syntax error'
end