Module: RubyNext::Language::Runtime

Defined in:
lib/ruby-next/language/runtime.rb

Overview

Module responsible for runtime transformations

Class Method Summary collapse

Class Method Details

.load(path, contents) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/ruby-next/language/runtime.rb', line 18

def load(path, contents)
  contents ||= File.read(path)
  new_contents = transform contents

  RubyNext.debug_source new_contents, path

  new_contents
end

.transform(contents, **options) ⇒ Object



27
28
29
# File 'lib/ruby-next/language/runtime.rb', line 27

def transform(contents, **options)
  Language.transform(contents, rewriters: Language.current_rewriters, **options)
end