freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FR-devel] ScriptRunner change


From: Laurent Julliard
Subject: Re: [FR-devel] ScriptRunner change
Date: Wed, 30 Apr 2003 09:31:23 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

David Naseby wrote:
Been having some problems with scriptrunner on Windows. Ruby is executed
from the current directory, meaning my require paths to local directories
are botched. This is unexpected behaviour for me at least.

To amend it, I made the following change to
rubyide_tools_fox_script_runner/script_runner.rb:
line 39:unless editpane.modified?
          file = plugin["/system/ui/current/EditPane"].data
+          current_directory = Dir.getwd
+          Dir.chdir( File.dirname( file ) )
          result = `ruby "#{file}" 2>&1`
+          Dir.chdir( current_directory )
          plugin["/system/ui/current/OutputPane"].manager.append("Run",
"<CMD>>ruby #{file}\n")
          plugin["/system/ui/current/OutputPane"].manager.append("Run",
result)
          plugin["/system/ui/current/OutputPane"].manager.append("Run",
"<CMD>>exit\n")
        end

David Naseby

Thanks for the patch. There is a number of pending issues that relate to this and they will be addressed globally:

a) Working directory at run time should be the directory where you are when you invoke FR. Not the case today (this will be fixed soon)

b) the Script Runner and the Debugger should have a dialog box where you can specify the working directory, the include paths, the ruby interpreter,etc... A quick fix is to assume the directory of the script to be the current directory. This will be changed soon

Laurent
--
Laurent JULLIARD - Xerox Global Services - XDD-G Manager
Tel: +33 (0)4 76 61 50 48 - Fax: +33 (0)4 76 61 51 99
>> Host your Xerox Software project on CodeX: http://codex.xerox.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]