public static MutableString Read(RubyContext /*!*/ context, RubyDir /*!*/ self) { self.ThrowIfClosed(); if (self._pos + 1 > self._rawEntries.Length) { return(null); } MutableString ret; if (self._pos == -2) { ret = context.EncodePath("."); } else if (self._pos == -1) { ret = context.EncodePath(".."); } else { ret = context.EncodePath(context.Platform.GetFileName(self._rawEntries[self._pos])); } self._pos++; return(ret); }
private RubyArray /*!*/ MakeLoadPaths(RubyOptions /*!*/ options) { var loadPaths = new RubyArray(); if (options.HasSearchPaths) { foreach (string path in options.SearchPaths) { loadPaths.Add(_context.EncodePath(path)); } } #if !SILVERLIGHT // no library paths on Silverlight string applicationBaseDir; try { applicationBaseDir = AppDomain.CurrentDomain.BaseDirectory; } catch (SecurityException) { applicationBaseDir = null; } AddAbsoluteLibraryPaths(loadPaths, applicationBaseDir, options.LibraryPaths); #endif loadPaths.Add(MutableString.CreateAscii(".")); return(loadPaths); }
private RubyArray /*!*/ GetEntries(RubyContext /*!*/ context) { ThrowIfClosed(); RubyArray ret = new RubyArray(_rawEntries.Length + 2); ret.Add(context.EncodePath(".")); ret.Add(context.EncodePath("..")); foreach (string entry in _rawEntries) { var encoded = context.TryEncodePath(context.Platform.GetFileName(entry)); if (encoded != null) { ret.Add(encoded); } } return(ret); }
public static IEnumerable <MutableString> /*!*/ GetMatches(RubyContext /*!*/ context, MutableString /*!*/ pattern, int flags) { string strPattern = context.DecodePath(pattern); foreach (string strFileName in GetMatches(context.Platform, strPattern, flags)) { yield return(context.EncodePath(strFileName).TaintBy(pattern)); } }
private RubyArray/*!*/ GetEntries(RubyContext/*!*/ context) { ThrowIfClosed(); RubyArray ret = new RubyArray(_rawEntries.Length + 2); ret.Add(context.EncodePath(".")); ret.Add(context.EncodePath("..")); foreach (string entry in _rawEntries) { var encoded = context.TryEncodePath(context.Platform.GetFileName(entry)); if (encoded != null) { ret.Add(encoded); } } return ret; }
public static MutableString Read(RubyContext/*!*/ context, RubyDir/*!*/ self) { self.ThrowIfClosed(); if (self._pos + 1 > self._rawEntries.Length) { return null; } MutableString ret; if (self._pos == -2) { ret = context.EncodePath("."); } else if (self._pos == -1) { ret = context.EncodePath(".."); } else { ret = context.EncodePath(context.Platform.GetFileName(self._rawEntries[self._pos])); } self._pos++; return ret; }
private RubyArray /*!*/ MakeLoadPaths(RubyOptions /*!*/ options) { var loadPaths = new RubyArray(); if (options.HasSearchPaths) { foreach (string path in options.SearchPaths) { loadPaths.Add(_context.EncodePath(path)); } } AddStandardLibraryPath(loadPaths, options.StandardLibraryPath, options.ApplicationBase); // TODO: remove? loadPaths.Add(MutableString.CreateAscii(".")); return(loadPaths); }
private bool RequireFile(string /*!*/ path, Scope scope) { return(_context.Loader.LoadFile(scope, null, _context.EncodePath(path), LoadFlags.Require)); }
public static IEnumerable<MutableString>/*!*/ GetMatches(RubyContext/*!*/ context, MutableString/*!*/ pattern, int flags) { string strPattern = context.DecodePath(pattern); foreach (string strFileName in GetMatches(context.Platform, strPattern, flags)) { yield return context.EncodePath(strFileName).TaintBy(pattern); } }