delete: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/io/sysopen_tags.txt;C807294
File: sysopen_tags.txt
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/io/sysopen_tags.txt;C807294  (server)    1/30/2010 4:10 PM
+++ [no target file]
@@ -1,4 +1,0 @@
-fails:IO.sysopen returns the file descriptor for a given path
-fails:IO.sysopen works on directories
-fails:IO.sysopen accepts a mode as second argument
-fails:IO.sysopen accepts permissions as third argument
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/dash_e_spec.rb;C1068248
File: dash_e_spec.rb
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/dash_e_spec.rb;C1068248  (server)    1/30/2010 5:59 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/command_line/dash_e_spec.rb;rc2fixes
@@ -23,5 +23,10 @@
   it "uses '-e' as $0" do
     ruby_exe("puts $0").chomp.should == "-e"
   end
+
+  it "preserves ARGV" do
+    ruby_exe(nil, :args => %Q{-eputs(ARGV);puts($0) 1 2 3 4}).chomp.should == "1\n2\n3\n4\n-e"
+  end
+
   #needs to test return => LocalJumpError
 end
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/exec_spec.rb;C966724
File: exec_spec.rb
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/exec_spec.rb;C966724  (server)    1/30/2010 4:10 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/exec_spec.rb;rc2fixes
@@ -8,7 +8,15 @@
   
   it "raises a SystemCallError if cmd cannot execute" do
     lambda { exec "" }.should raise_error(SystemCallError)
-  end  
+  end
+
+  it 'can call bat files' do
+    ruby_exe("exec '#{File.dirname(__FILE__) + "/fixtures/comspec.bat"} success'").chomp.should == 'success'
+  end
+
+  it 'can call cmd files' do
+    ruby_exe("exec '#{File.dirname(__FILE__) + "/fixtures/comspec.cmd"} success'").chomp.should == 'success'
+  end
 end
 
 describe "Kernel.exec" do
===================================================================
add: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/fixtures/comspec.bat
File: comspec.bat
===================================================================
--- [no source file]
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/fixtures/comspec.bat;rc2fixes
@@ -1,0 +1,1 @@
+@echo %*
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/RubyUtilsTests.cs;C1305319
File: RubyUtilsTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/RubyUtilsTests.cs;C1305319  (server)    1/29/2010 5:47 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/RubyUtilsTests.cs;rc2fixes
@@ -45,6 +45,7 @@
             Assert(RubyUtils.TryUnmangleName("as") == "As");
             Assert(RubyUtils.TryUnmangleName("my") == "My");
             Assert(RubyUtils.TryUnmangleName("me") == "Me");
+            Assert(RubyUtils.TryUnmangleName("no") == "No");
             
             Assert(RubyUtils.TryUnmangleName("ip") == "IP");
             Assert(RubyUtils.TryUnmangleName("rx") == "RX");
@@ -110,6 +111,8 @@
             Assert(RubyUtils.TryUnmangleName("ME") == null);
             Assert(RubyUtils.TryUnmangleName("ID") == null);
             Assert(RubyUtils.TryUnmangleName("OK") == null);
+            Assert(RubyUtils.TryUnmangleName("NO") == null);
+
 
             Assert(RubyUtils.TryMangleName("NaN") == null);
             Assert(RubyUtils.TryMangleName("NaNValue") == null);
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C1544575
File: Initializers.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C1544575  (server)    1/29/2010 5:47 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;rc2fixes
@@ -1831,8 +1831,8 @@
             );
             
             DefineLibraryMethod(module, "each", 0x51, 
-                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, System.Object>(IronRuby.Builtins.RubyIOOps.Each), 
-                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, IronRuby.Builtins.MutableString, System.Object>(IronRuby.Builtins.RubyIOOps.Each)
+                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, IronRuby.Builtins.MutableString, System.Object>(IronRuby.Builtins.RubyIOOps.Each), 
+                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, System.Object>(IronRuby.Builtins.RubyIOOps.Each)
             );
             
             DefineLibraryMethod(module, "each_byte", 0x51, 
@@ -1840,8 +1840,8 @@
             );
             
             DefineLibraryMethod(module, "each_line", 0x51, 
-                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, System.Object>(IronRuby.Builtins.RubyIOOps.Each), 
-                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, IronRuby.Builtins.MutableString, System.Object>(IronRuby.Builtins.RubyIOOps.Each)
+                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, IronRuby.Builtins.MutableString, System.Object>(IronRuby.Builtins.RubyIOOps.Each), 
+                new Func<IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyIO, System.Object>(IronRuby.Builtins.RubyIOOps.Each)
             );
             
             DefineLibraryMethod(module, "eof", 0x51, 
@@ -2057,6 +2057,10 @@
                 new Func<IronRuby.Runtime.RubyContext, System.Object, IronRuby.Builtins.RubyArray, IronRuby.Builtins.RubyArray, IronRuby.Builtins.RubyArray, System.Double, IronRuby.Builtins.RubyArray>(IronRuby.Builtins.RubyIOOps.Select)
             );
             
+            DefineLibraryMethod(module, "sysopen", 0x61, 
+                new Func<IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, IronRuby.Builtins.MutableString, System.Int32, System.Int32>(IronRuby.Builtins.RubyIOOps.SysOpen)
+            );
+            
         }
         
         private static void LoadIronRuby_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
@@ -3176,10 +3180,10 @@
             );
             
             DefineLibraryMethod(module, "puts", 0x52, 
+                new Action<IronRuby.Runtime.BinaryOpStorage, System.Object>(IronRuby.Builtins.KernelOps.PutsEmptyLine), 
+                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object>(IronRuby.Builtins.KernelOps.PutString), 
                 new Action<IronRuby.Runtime.BinaryOpStorage, System.Object, IronRuby.Builtins.MutableString>(IronRuby.Builtins.KernelOps.PutString), 
-                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object[]>(IronRuby.Builtins.KernelOps.PutString), 
-                new Action<IronRuby.Runtime.BinaryOpStorage, System.Object>(IronRuby.Builtins.KernelOps.PutsEmptyLine), 
-                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object>(IronRuby.Builtins.KernelOps.PutString)
+                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object[]>(IronRuby.Builtins.KernelOps.PutString)
             );
             
             DefineLibraryMethod(module, "raise", 0x52, 
@@ -3479,10 +3483,10 @@
             );
             
             DefineLibraryMethod(module, "puts", 0x61, 
+                new Action<IronRuby.Runtime.BinaryOpStorage, System.Object>(IronRuby.Builtins.KernelOps.PutsEmptyLine), 
+                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object>(IronRuby.Builtins.KernelOps.PutString), 
                 new Action<IronRuby.Runtime.BinaryOpStorage, System.Object, IronRuby.Builtins.MutableString>(IronRuby.Builtins.KernelOps.PutString), 
-                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object[]>(IronRuby.Builtins.KernelOps.PutString), 
-                new Action<IronRuby.Runtime.BinaryOpStorage, System.Object>(IronRuby.Builtins.KernelOps.PutsEmptyLine), 
-                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object>(IronRuby.Builtins.KernelOps.PutString)
+                new Action<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.ConversionStorage<IronRuby.Builtins.MutableString>, IronRuby.Runtime.ConversionStorage<System.Collections.IList>, System.Object, System.Object[]>(IronRuby.Builtins.KernelOps.PutString)
             );
             
             DefineLibraryMethod(module, "raise", 0x61, 
@@ -8699,11 +8703,11 @@
             );
             
             DefineLibraryMethod(module, "<=>", 0x11, 
+                new Func<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, IronRuby.StandardLibrary.BigDecimal.BigDecimal, System.Object, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare), 
                 new Func<IronRuby.StandardLibrary.BigDecimal.BigDecimal, IronRuby.StandardLibrary.BigDecimal.BigDecimal, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare), 
                 new Func<IronRuby.Runtime.RubyContext, IronRuby.StandardLibrary.BigDecimal.BigDecimal, Microsoft.Scripting.Math.BigInteger, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare), 
                 new Func<IronRuby.Runtime.RubyContext, IronRuby.StandardLibrary.BigDecimal.BigDecimal, System.Int32, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare), 
-                new Func<IronRuby.Runtime.RubyContext, IronRuby.StandardLibrary.BigDecimal.BigDecimal, System.Double, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare), 
-                new Func<IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, IronRuby.StandardLibrary.BigDecimal.BigDecimal, System.Object, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare)
+                new Func<IronRuby.Runtime.RubyContext, IronRuby.StandardLibrary.BigDecimal.BigDecimal, System.Double, System.Object>(IronRuby.StandardLibrary.BigDecimal.BigDecimalOps.Compare)
             );
             
             DefineLibraryMethod(module, "==", 0x11, 
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs;C1479538
File: IoOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs;C1479538  (server)    1/30/2010 3:22 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs;rc2fixes
@@ -368,7 +368,20 @@
 
         #endregion
 
-        //sysopen
+        #region sysopen
+        [RubyMethod("sysopen", RubyMethodAttributes.PublicSingleton)]
+        public static int SysOpen(RubyClass/*!*/ self, [NotNull]MutableString path, [Optional]MutableString mode, [Optional]int perm) {
+            if (RubyFileOps.DirectoryExists(self.Context, path)) {
+                // TODO: What file descriptor should be returned for a directory?
+                return -1;
+            }
+            RubyIO io = new RubyFile(self.Context, path.ToString(), IOModeEnum.Parse(mode));
+            int fileDesc = io.GetFileDescriptor();
+            io.Close();
+            return fileDesc;
+        }
+        #endregion
+
 
         [RubyMethod("binmode")]
         public static RubyIO/*!*/ Binmode(RubyIO/*!*/ self) {
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyProcess.cs;C1496258
File: RubyProcess.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyProcess.cs;C1496258  (server)    1/29/2010 5:47 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyProcess.cs;rc2fixes
@@ -178,7 +178,7 @@
             return -1;
         }
 
-        private static string[] _ExecutableExtensions = new[] { ".exe", ".com" };
+        private static string[] _ExecutableExtensions = new[] { ".exe", ".com", ".bat", ".cmd" };
 
         private static IEnumerable<string>/*!*/ GetExecutableFiles(PlatformAdaptationLayer/*!*/ pal, string/*!*/ path) {
             if (path[0] == '"' || path[path.Length - 1] == '"') {
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Zlib/zlib.cs;C1438355
File: zlib.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Zlib/zlib.cs;C1438355  (server)    1/29/2010 5:47 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Zlib/zlib.cs;rc2fixes
@@ -930,7 +930,6 @@
 #if !SILVERLIGHT
         [RubyClass("Deflate", BuildConfig="!SILVERLIGHT")]
         public class Deflate : ZStream {
-
             /// <summary>
             /// Adds a 2 byte header, and a 4 byte adler checksum footer.
             /// </summary>
@@ -1041,7 +1040,24 @@
                 };
             }
 
-            public Deflate() {
+            public Deflate()
+                : this(-1, -1, -1, -1) {
+            }
+
+            public Deflate(int level)
+                : this(level, -1, -1, -1) {
+            }
+
+            public Deflate(int level, int windowBits)
+                : this(level, windowBits, -1, -1) {
+            }
+
+            public Deflate(int level, int windowBits, int memlevel)
+                : this(level, windowBits, memlevel, -1) {
+            }
+
+            public Deflate(int level, int windowBits, int memlevel, int strategy) {
+                // TODO: use parameters
             }
 
             [RubyMethod("deflate")]
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs;C1496258
File: RubyOptionsParser.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs;C1496258  (server)    1/30/2010 5:56 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs;rc2fixes
@@ -270,8 +270,13 @@
                         if (mainFileFromPath != null) {
                             ConsoleOptions.FileName = FindMainFileFromPath(mainFileFromPath);
                         }
-                        LanguageSetup.Options["MainFile"] = RubyUtils.CanonicalizePath(ConsoleOptions.FileName);
-                        LanguageSetup.Options["Arguments"] = PopRemainingArgs();
+
+                        if (ConsoleOptions.Command == null) {
+                            SetupOptionsForMainFile();
+                        } else {
+                            SetupOptionsForCommand();
+                        }
+                        
                         LanguageSetup.Options["ArgumentEncoding"] = 
 #if SILVERLIGHT
                             RubyEncoding.UTF8;
@@ -283,6 +288,22 @@
             }
         }
 
+        private void SetupOptionsForMainFile() {
+            LanguageSetup.Options["MainFile"] = RubyUtils.CanonicalizePath(ConsoleOptions.FileName);
+            LanguageSetup.Options["Arguments"] = PopRemainingArgs();;
+        }
+
+        private void SetupOptionsForCommand() {
+            string firstArg = ConsoleOptions.FileName;
+            ConsoleOptions.FileName = null;
+
+            List<string> args = new List<string>(new string[] { firstArg });
+            args.AddRange(PopRemainingArgs());
+
+            LanguageSetup.Options["MainFile"] = "-e";
+            LanguageSetup.Options["Arguments"] = args.ToArray();
+        }
+
         private string FindMainFileFromPath(string mainFileFromPath) {
             string path = Platform.GetEnvironmentVariable("PATH");
             foreach (string p in path.Split(';')) {
===================================================================
edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C1496258
File: RubyUtils.cs
===================================================================
--- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C1496258  (server)    1/29/2010 5:47 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;rc2fixes
@@ -419,6 +419,7 @@
                 case ('g' << 8) | 'o':
                 case ('m' << 8) | 'e':
                 case ('m' << 8) | 'y':
+                case ('n' << 8) | 'o':
                 case ('o' << 8) | 'f':
                 case ('o' << 8) | 'k':
                 case ('o' << 8) | 'n':
===================================================================
