Sha256: 56cf6fef49ccf980a32413e2ae8948cb306c1fa0a4c59d97f20499ef61c286d6

Contents?: true

Size: 1.39 KB

Versions: 12

Compression:

Stored size: 1.39 KB

Contents

require "generator"
require "johnson/version"

# the command-line option parser and support libs
require "johnson/cli"

# the native SpiderMonkey extension
require "johnson/spidermonkey"

# visitable module and visitors
require "johnson/visitable"
require "johnson/visitors"

# parse tree nodes
require "johnson/nodes"

# the SpiderMonkey bits written in Ruby
require "johnson/spidermonkey/runtime"
require "johnson/spidermonkey/context"
require "johnson/spidermonkey/js_land_proxy"
require "johnson/spidermonkey/ruby_land_proxy"
require "johnson/spidermonkey/mutable_tree_visitor"
require "johnson/spidermonkey/debugger"
require "johnson/spidermonkey/immutable_node"

# the 'public' interface
require "johnson/error"
require "johnson/runtime"
require "johnson/parser"

# make sure all the Johnson JavaScript libs are in the load path
$LOAD_PATH.push(File.expand_path("#{File.dirname(__FILE__)}/../js"))

module Johnson
  PRELUDE = IO.read(File.dirname(__FILE__) + "/../js/johnson/prelude.js")
  
  def self.evaluate(expression, vars={})
    runtime = Johnson::Runtime.new
    vars.each { |key, value| runtime[key] = value }
    
    runtime.evaluate(expression)
  end
  
  def self.parse(js, *args)
    Johnson::Parser.parse(js, *args)
  end

  ###
  # Create a new runtime and load all +files+.  Returns a new Johnson::Runtime.
  def self.load(*files)
    rt = Johnson::Runtime.new
    rt.load(*files)
    rt
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
jbarnette-johnson-1.0.0.200811251942 lib/johnson.rb
jbarnette-johnson-1.0.0.20081126120511 lib/johnson.rb
jbarnette-johnson-1.0.0.20090127202936 lib/johnson.rb
jbarnette-johnson-1.0.0.20090225110820 lib/johnson.rb
jbarnette-johnson-1.0.0.20090326122910 lib/johnson.rb
jbarnette-johnson-1.0.0.20090326154650 lib/johnson.rb
jbarnette-johnson-1.0.0.20090326161333 lib/johnson.rb
jbarnette-johnson-1.0.0.20090402144841 lib/johnson.rb
jbarnette-johnson-1.0.0.20090402155420 lib/johnson.rb
johnson-1.1.1 lib/johnson.rb
johnson-1.1.2 lib/johnson.rb
johnson-1.1.0 lib/johnson.rb