module Esnext::Source

Public Class Methods

bundled_path() click to toggle source
# File lib/esnext.rb, line 18
def self.bundled_path
  File.expand_path('../../vendor/esnext.js', __FILE__)
end
contents() click to toggle source
# File lib/esnext.rb, line 22
def self.contents
  @contents ||= File.read(path)
end
context() click to toggle source
# File lib/esnext.rb, line 30
def self.context
  @context ||= ExecJS.compile(contents)
end
path() click to toggle source
# File lib/esnext.rb, line 9
def self.path
  @path ||= ENV['ESNEXT_SOURCE_PATH'] || bundled_path
end
path=(path) click to toggle source
# File lib/esnext.rb, line 13
def self.path=(path)
  @contents = @version = @context = nil
  @path = path
end
version() click to toggle source
# File lib/esnext.rb, line 26
def self.version
  @version ||= contents[/esnext v([\d.]+)/, 1]
end