public static MutableString/*!*/ ExpandPath(ConversionStorage<MutableString>/*!*/ toPath, RubyClass/*!*/ self, object path,
[DefaultParameterValue(null)]object basePath) {
var context = self.Context;
string result = RubyUtils.ExpandPath(
context.Platform,
context.DecodePath(Protocols.CastToPath(toPath, path)),
(basePath == null) ? context.Platform.CurrentDirectory : context.DecodePath(Protocols.CastToPath(toPath, basePath)),
true
);
return self.Context.EncodePath(result);
}