Get Off My Lawn

Adventures of a Curmudgeon

NTS: Rubyscript2exe Modifications

I have occasion to build Ruby applications for Windows. And it seems like I have to modify rubyscript2exe on each machine. Here are my changes (these are made directly to the gem files):

[GEM_DIR]/rubyscript2exe-0.5.3/bin/rubyscript2exe

Before: gemdir= File.expand_path(“..”, File.dirname(FILE)) realstuff= File.expand_path(“realstuff.rb”, gemdir) isapplication= File.basename(File.dirname(FILE)) == “bin” $0.replace(realstuff)if isapplication load(realstuff)After: gemdir= File.expand_path(“..”, File.dirname(FILE)) realstuff= File.expand_path(“realstuff.rb”, gemdir) isapplication= File.basename(File.dirname(FILE)) == “bin” $0 = realstuff alias $__0 $0 alias $0 $0 $0.replace(realstuff)if isapplication load(realstuff)

[GEM_DIR]/rubyscript2exe-0.5.3/realstuff.rb

For me this starts on line 620:Before: if FILE == $0 $0.replace(File.expand_path(“./init.rb”)) TAR2RUBYSCRIPT= trueunless defined?(TAR2RUBYSCRIPT)After: if FILE == $0 $0 = File.expand_path(“./init.rb”) alias $__0 $0 alias $0 $0 TAR2RUBYSCRIPT= trueunless defined?(TAR2RUBYSCRIPT)

Again: This works for me. YMMV!

Cheers!