How to pass args to Ruby script under SciTE?

//I’m using the Scintilla Text Editor for writing an testing
//Ruby scripts. I’m currently writing one that should accept a
//single argument when it is run. How can I put such an
//argument in SciTE’s environment so that when the scripts
//references ARGV[0], the first argument is returned from the
//environment?

You may not like this, but here goes:

Take your ruby.properties file (you will find it in the option menu)
Now try and find the go command (should be right at the bottom), mine
looks like this:
command.go.*.rb=d:\roshanj\progs\ruby1.8\bin\ruby.exe
$(FileNameExt)

Simply edit this to add arguements
command.go.*.rb=d:\roshanj\progs\ruby1.8\bin\ruby.exe
(FileNameExt) (args)

Now go to the top of the file and add your args
args=

Of course, this means that you will have to edit ruby.properties and
changes args when you need to, but it’ll work.
Don’t say I didn’t warn you about not liking it.

  • rosh

InterScan_Disclaimer.txt (520 Bytes)