module Myth::Source

Public Class Methods

contents() click to toggle source
# File lib/myth.rb, line 19
def self.contents
  @contents ||= File.read(path)
end
context() click to toggle source
# File lib/myth.rb, line 27
def self.context
  # Window or self has to be added so myth can attach to something
  @context ||= ExecJS.compile("preprocess=function(css,options){try{css=myth(css,options);}catch(e){e.css=css;throw e;}return css;};if(typeof self==\"undefined\")self={};" + contents + "if(self.myth)myth=self.myth;")
end
path() click to toggle source
# File lib/myth.rb, line 10
def self.path
  @path ||= ENV['MYTH_SOURCE_PATH'] || bundled_path
end
path=(path) click to toggle source
# File lib/myth.rb, line 14
def self.path=(path)
  @contents = @version = @context = nil
  @path = path
end
version() click to toggle source
# File lib/myth.rb, line 23
def self.version
  @version ||= contents[/Myth Preprocessor v([\d.]+)/, 1]
end