Class: Shell

Inherits:
ArcadiaExt
  • Object
show all
Defined in:
ext/ae-shell/ae-shell.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



11
12
13
# File 'ext/ae-shell/ae-shell.rb', line 11

def build
  @run_threads = Array.new
end

#run(_filename = nil) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'ext/ae-shell/ae-shell.rb', line 33

def run(_filename=nil)
  if _filename
    begin
      $arcadia['pers']['run.file.last']=_filename
      @run_threads << Thread.new{
        _cmd_ = "|"+$arcadia['conf']['shell.ruby']+" "+_filename+" 2>&1"
        #MsgContract.instance.out_debug(self, _cmd_)
        @cmd = open(_cmd_,"r"){
          |f|
          MsgContract.instance.out_debug(self, f.read)
      }
    }
    rescue Exception => e
      MsgContract.instance.out_debug(self, e)
    end
  end
end

#run_currentObject



19
20
21
22
# File 'ext/ae-shell/ae-shell.rb', line 19

def run_current
  current_editor = $arcadia['editor'].raised
  run(current_editor.file) if current_editor
end

#run_lastObject



15
16
17
# File 'ext/ae-shell/ae-shell.rb', line 15

def run_last
  run($arcadia['pers']['run.file.last'])
end

#stopObject



24
25
26
27
28
29
30
31
# File 'ext/ae-shell/ae-shell.rb', line 24

def stop
  @run_threads.each{|t|
    if t.alive?
      t.kill
    end
  }
  debug_quit if @adw
end