public static object Open(BlockParam block, RubyClass /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ path) { var strPath = self.Context.DecodePath(path); var file = new RubyFile(self.Context, strPath, IOMode.ReadOnly); var gzipReader = Create(self, file); return(gzipReader.Do(block)); }
public static object ParseFile(RubyModule /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ path) { using (Stream stream = new RubyFile(self.Context, path.ConvertToString(), IOMode.Default).GetReadableStream()) { foreach (Node obj in MakeComposer(self.Context, stream)) { return(obj); } } return(ScriptingRuntimeHelpers.False); }
public static object LoadFile(RubyScope /*!*/ scope, RubyModule /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ path) { using (RubyFile file = new RubyFile(self.Context, path.ConvertToString(), IOMode.Default)) { foreach (object obj in MakeConstructor(scope.GlobalScope, file.GetReadableStream())) { return(obj); } } return(null); }
public static object Open(BlockParam block, RubyClass /*!*/ self, [DefaultProtocol, NotNull] MutableString /*!*/ path, [DefaultParameterValue(0)] int level, [DefaultParameterValue(DEFAULT_STRATEGY)] int strategy) { var strPath = self.Context.DecodePath(path); var file = new RubyFile(self.Context, strPath, IOMode.WriteOnly | IOMode.Truncate | IOMode.CreateIfNotExists); var gzipWriter = Create(self, file, level, strategy); return(gzipWriter.Do(block)); }