Class: CodeRunner::Cronos::EngineHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/cronoscrmod/cronos.rb

Instance Method Summary collapse

Constructor Details

#initialize(engine) ⇒ EngineHandler

Returns a new instance of EngineHandler.



10
11
12
13
14
# File 'lib/cronoscrmod/cronos.rb', line 10

def initialize(engine)
  @engine = engine
  @cronos_path_set = false
  @pathc
end

Instance Method Details

#new_fileObject



27
28
29
30
# File 'lib/cronoscrmod/cronos.rb', line 27

def new_file
  @engine.eval_string("zuicreate")
  STDIN.gets
end

#start_cronos(path) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cronoscrmod/cronos.rb', line 15

def start_cronos(path)
  return
  return if @cronos_path_set
  raise "cronos not found in #{path}" unless FileTest.exist?("#{path}/cronos.m")
  @engine.eval_string("addpath #{File.expand_path(path)};")
  @engine.eval_string("addpath #{File.expand_path(path)}/interface;")
  @engine.eval_string("addpath #{File.expand_path(path)}/op;")
  @engine.eval_string("cronos")
  @engine.eval_string("zuidirect")
  @cronos_path_set = true
end