From 9c609ee29946829eb6fe41ee9fe4fe22fc9cae5f Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 8 May 2014 19:30:46 +0300 Subject: [PATCH] make machine init default to the running one with ruby config --- lib/vm/program.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/vm/program.rb b/lib/vm/program.rb index 124e0c7c..707d835a 100644 --- a/lib/vm/program.rb +++ b/lib/vm/program.rb @@ -20,8 +20,11 @@ module Vm # Initialize with a string for cpu. Naming conventions are: for Machine XXX there exists a module XXX # with a XXXMachine in it that derives from Vm::Machine - def initialize machine + def initialize machine = nil super("start") + machine = RbConfig::CONFIG["host_cpu"] unless machine + machine = "intel" if machine == "x86_64" + machine = machine.capitalize Machine.instance = eval("#{machine}::#{machine}Machine").new @context = Context.new(self) #global objects (data)