class CodeRunner::Cronos::CronosHandler

Attributes

cronos[R]

Public Class Methods

new(runner) click to toggle source
# File lib/cronoscrmod/cronos.rb, line 55
def initialize(runner)
        if runner and runner.executable
                start_cronos(runner.executable)
        end
end

Public Instance Methods

new_file() click to toggle source
# File lib/cronoscrmod/cronos.rb, line 73
def new_file
        @cronos.puts("zuicreate")
end
restart_cronos(path) click to toggle source
# File lib/cronoscrmod/cronos.rb, line 69
def restart_cronos(path)
        @cronos_started = false
        start_cronos(path)
end
start_cronos(path) click to toggle source
# File lib/cronoscrmod/cronos.rb, line 62
def start_cronos(path)
        return if @cronos_started
        raise "cronos not found in #{path}" unless FileTest.exist?("#{path}/cronos.m")
        @cronos = IO.popen("#{path}/cronos 3>&2 2>&1 1>&3 | grep -v 'Time Machine' 3>&2 2>&1 1>&3 ",  'w')
        @cronos.puts("addpath('#{CodeRunner::Cronos.rcp.code_module_folder}/matlab')")
        @cronos_started = true
end