Skip to content

Instantly share code, notes, and snippets.

@thomasjslone
Last active November 16, 2024 03:55
Show Gist options
  • Save thomasjslone/50cd6c6c78fa2b7006738051715106d6 to your computer and use it in GitHub Desktop.
Save thomasjslone/50cd6c6c78fa2b7006738051715106d6 to your computer and use it in GitHub Desktop.
rubin launcher finnaly serves a purpose, link to entry point and configure runtime perams
## launch.rb ; file ver 1.0 for rubin 1.0.4 and up ; Rubin system default launcher. Thomas J Slone 2024 11 3
##big news! this file is now a proper launcher, rubin can still be started by loading the system file in an interpreter from the home directory
## however this launcher will perform startup checks and configure the interpreter for various runtime modes (such as debug, windowless, server, low memory)
##this file is the entry point for rubin system, it can be ran a few ways, explorer.exe can have it clicked, cmd.exe can tell ruby.exe to run this file, or an already running
##interpreter can load this file, this file cannot be evaled by a client/console outside of the install directory
##prepare args to be passed if there are any
if ARGV.length > 0 ; $argv = ARGV ; $argv.insert(0,"-") ; $argv = $argv.join(" ")
else ; $argv = ""
end
## check core file before launching
if File.file?(Dir.getwd+"/system/rubin.rb") == false
raise "Rubin launcher failed to locate the core system file: rubin.rb.\nCurrent work directory: "+Dir.getwd
end
## ask host to launch ruby interpreter
system("start ruby.exe -e 'load Dir.getwd + \"/system/rubin.rb\"' "+$argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment