Hey,
In the progress of investigating why with the last git revision,
ir.exe in repl mode doesn't print the result of the evaluation, I
figured I'd write the most useful patch of the year, to get a cute
prompt on Mono:
[mono] ~/Desktop/Debug @ mono ir.exe
IronRuby 1.0.0.0 on Mono 2.5
Copyright (c) Microsoft Corporation. All rights reserved.
That's the documented way to do so, and will be maintained that way.
Thanks,
--
Jb Evain <[email protected]>
diff --git a/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs b/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
index 8ad56a0..ef00ed1 100644
--- a/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
+++ b/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
@@ -14,6 +14,7 @@
* ***************************************************************************/
using System;
+using System.Reflection;
using IronRuby.Builtins;
using IronRuby.Runtime;
using Microsoft.Scripting;
@@ -32,11 +33,19 @@ namespace IronRuby.Hosting {
protected override string Logo {
get {
- return String.Format("IronRuby {1} on .NET {2}{0}Copyright (c) Microsoft Corporation. All rights reserved.{0}{0}",
- Environment.NewLine, RubyContext.IronRubyVersion, Environment.Version);
+ return String.Format("IronRuby {1} on {2}{0}Copyright (c) Microsoft Corporation. All rights reserved.{0}{0}",
+ Environment.NewLine, RubyContext.IronRubyVersion, GetRuntimeName());
}
}
+ private static string GetRuntimeName()
+ {
+ Type monoRuntime = typeof(object).Assembly.GetType("Mono.Runtime");
+ return monoRuntime != null ?
+ (string) monoRuntime.GetMethod("GetDisplayName", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null)
+ : string.Format(".NET {0}", Environment.Version);
+ }
+
protected override int? TryInteractiveAction() {
try {
return base.TryInteractiveAction();
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core