示例#1
0
        private string GetControllerFilePath(string controllerName)
        {
            var fileName = Constants.ControllerPascalPathFormat.FormattedWith(controllerName.Pascalize());

            if (_pathProvider.FileExists(fileName))
            {
                return(fileName);
            }

            fileName = Constants.ControllerUnderscorePathFormat.FormattedWith(controllerName.Underscore());

            return(_pathProvider.FileExists(fileName) ? fileName : string.Empty);
        }
示例#2
0
        private static void ProcessRubyRoutes(IRubyEngine engine, IPathProvider vpp, string routesPath)
        {
            if (!vpp.FileExists(routesPath))
            {
                return;
            }
            var routeCollection = new RubyRoutes(RouteTable.Routes);

            engine.DefineReadOnlyGlobalVariable("routes", routeCollection);
            engine.RequireRubyFile(routesPath, ReaderType.File);
        }
示例#3
0
 public override bool FileExists(string path)
 {
     return(_pathProvider.FileExists(path));
 }