Module: Jack

Defined in:
lib/jack.rb

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.logObject



24
# File 'lib/jack.rb', line 24

def self.log; @log end

.run(app_file, options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jack.rb', line 10

def self.run(app_file, options)
  @js = Johnson::Runtime.new
  @js.load(File.dirname(__FILE__) + "/jack.js")
  Dir.glob(File.dirname(__FILE__) + "/jack/*.js").each { |f| @js.load(f) }

  @log = Logger.new(options.log)
  @log.info "Starting #{app_file} on http://#{options.host}:#{options.port}"
  @js['Jack']['root'] = File.dirname(app_file)
  @js['Jack']['log']  = @log # Why can't we go the other way? (Jack.log = Ruby.Jack.log)
  @js['Jack']['options'] = {:Port => options.port, :Host => options.host}

  @js.load(app_file)
end