Browse Source

Changes in Tools-Options for the IronPython and IronRuby console application filename are now picked up when using Python-Run or Ruby-Run.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6364 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 16 years ago
parent
commit
82c8b61d80
  1. 13
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleApplication.cs
  2. 9
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonConsoleApplicationTestFixture.cs
  3. 8
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs
  4. 9
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTestFixture.cs

13
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleApplication.cs

@ -13,7 +13,7 @@ namespace ICSharpCode.PythonBinding
{ {
public class PythonConsoleApplication public class PythonConsoleApplication
{ {
string fileName = String.Empty; PythonAddInOptions options;
StringBuilder arguments; StringBuilder arguments;
bool debug; bool debug;
string pythonScriptFileName = String.Empty; string pythonScriptFileName = String.Empty;
@ -21,17 +21,12 @@ namespace ICSharpCode.PythonBinding
string workingDirectory = String.Empty; string workingDirectory = String.Empty;
public PythonConsoleApplication(PythonAddInOptions options) public PythonConsoleApplication(PythonAddInOptions options)
: this(options.PythonFileName)
{ {
} this.options = options;
public PythonConsoleApplication(string fileName)
{
this.fileName = fileName;
} }
public string FileName { public string FileName {
get { return fileName; } get { return options.PythonFileName; }
} }
public bool Debug { public bool Debug {
@ -57,7 +52,7 @@ namespace ICSharpCode.PythonBinding
public ProcessStartInfo GetProcessStartInfo() public ProcessStartInfo GetProcessStartInfo()
{ {
ProcessStartInfo processStartInfo = new ProcessStartInfo(); ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = fileName; processStartInfo.FileName = FileName;
processStartInfo.Arguments = GetArguments(); processStartInfo.Arguments = GetArguments();
processStartInfo.WorkingDirectory = workingDirectory; processStartInfo.WorkingDirectory = workingDirectory;
return processStartInfo; return processStartInfo;

9
src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonConsoleApplicationTestFixture.cs

@ -91,5 +91,14 @@ namespace PythonBinding.Tests.Testing
ProcessStartInfo startInfo = app.GetProcessStartInfo(); ProcessStartInfo startInfo = app.GetProcessStartInfo();
Assert.AreEqual(@"d:\temp", startInfo.WorkingDirectory); Assert.AreEqual(@"d:\temp", startInfo.WorkingDirectory);
} }
[Test]
public void ChangingOptionsPythonFileNameChangesProcessStartInfoFileName()
{
options.PythonFileName = @"d:\temp\test\ipy.exe";
ProcessStartInfo startInfo = app.GetProcessStartInfo();
Assert.AreEqual(@"d:\temp\test\ipy.exe", startInfo.FileName);
}
} }
} }

8
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs

@ -14,7 +14,7 @@ namespace ICSharpCode.RubyBinding
{ {
public class RubyConsoleApplication public class RubyConsoleApplication
{ {
string fileName; RubyAddInOptions options;
bool debug; bool debug;
List<string> loadPaths = new List<string>(); List<string> loadPaths = new List<string>();
string rubyScriptFileName = String.Empty; string rubyScriptFileName = String.Empty;
@ -25,11 +25,11 @@ namespace ICSharpCode.RubyBinding
public RubyConsoleApplication(RubyAddInOptions options) public RubyConsoleApplication(RubyAddInOptions options)
{ {
this.fileName = options.RubyFileName; this.options = options;
} }
public string FileName { public string FileName {
get { return fileName; } get { return options.RubyFileName; }
} }
public bool Debug { public bool Debug {
@ -60,7 +60,7 @@ namespace ICSharpCode.RubyBinding
public ProcessStartInfo GetProcessStartInfo() public ProcessStartInfo GetProcessStartInfo()
{ {
ProcessStartInfo processStartInfo = new ProcessStartInfo(); ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = fileName; processStartInfo.FileName = FileName;
processStartInfo.Arguments = GetArguments(); processStartInfo.Arguments = GetArguments();
processStartInfo.WorkingDirectory = workingDirectory; processStartInfo.WorkingDirectory = workingDirectory;
return processStartInfo; return processStartInfo;

9
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTestFixture.cs

@ -91,5 +91,14 @@ namespace RubyBinding.Tests.Testing
ProcessStartInfo startInfo = app.GetProcessStartInfo(); ProcessStartInfo startInfo = app.GetProcessStartInfo();
Assert.AreEqual(@"d:\temp", startInfo.WorkingDirectory); Assert.AreEqual(@"d:\temp", startInfo.WorkingDirectory);
} }
[Test]
public void ChangingOptionsRubyFileNameChangesProcessStartInfoFileName()
{
options.RubyFileName = @"d:\temp\test\ir.exe";
ProcessStartInfo startInfo = app.GetProcessStartInfo();
Assert.AreEqual(@"d:\temp\test\ir.exe", startInfo.FileName);
}
} }
} }

Loading…
Cancel
Save