module Opal
def self.append_path(path)
here should only be paths which contain code targeted at being compiled by
has access to should add a load path through this method. Load paths added
Add a file path to opals load path. Any gem containing ruby code that Opal
def self.append_path(path) append_paths(path) end
def self.append_paths(*paths)
def self.append_paths(*paths) @paths.concat(paths) nil end
def self.compile(source, options = {})
-
(String)
- javascript code
Parameters:
-
options
(Hash
) -- compiler options -
source
(String
) -- ruby source
Other tags:
- See: Opal::Compiler.new - for compiler options
def self.compile(source, options = {}) Compiler.new(source, options).compile end
def self.core_dir
def self.core_dir File.expand_path('../../../opal', __FILE__.untaint) end
def self.gem_dir
def self.gem_dir File.expand_path('../..', __FILE__.untaint) end
def self.paths
def self.paths @paths.dup.freeze end
def self.reset_paths!
def self.reset_paths! @paths = [core_dir.untaint, std_dir.untaint, gem_dir.untaint] nil end
def self.std_dir
def self.std_dir File.expand_path('../../../stdlib', __FILE__.untaint) end