Class: Gisele::VM::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/gisele/vm/command.rb

Overview

The Gisele Virtual Machine

SYNOPSIS

gvm [--version] [--help]
gvm [--drb-server] [options] GIS_FILE
gvm --drb-client [options]

OPTIONS #summarized_options

Instance Method Summary collapse

Instance Method Details

#execute(args) ⇒ Object

Raises:

  • (Quickl::Help)


76
77
78
79
80
81
82
83
84
# File 'lib/gisele/vm/command.rb', line 76

def execute(args)
  raise Quickl::Help if args.size > 1
  @gis_file = Path(args.shift)
  case @mode
  when :run        then start_vm
  when :compile    then puts VM.compile(@gis_file)
  when :gts        then puts VM.gts(@gis_file).to_dot
  end
end

#vm(gis_file = @gis_file) ⇒ Object



86
87
88
# File 'lib/gisele/vm/command.rb', line 86

def vm(gis_file = @gis_file)
  @vm ||= @drb_client ? drb_vm : real_vm(gis_file)
end