Skip to content

Commit

Permalink
Makes call to require so it can be patched
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Oct 14, 2009
1 parent 65d978f commit bc80a30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion IronRubyMvc/Controllers/RubyControllerFactory.cs
Expand Up @@ -67,7 +67,7 @@ private RubyController LoadController(RequestContext requestContext, string cont
if (controllerFilePath.IsNullOrBlank())
return null;

_engine.RequireRubyFile(controllerFilePath, ReaderType.File);
_engine.RequireRubyFile(controllerFilePath);

var controllerClass = _engine.GetRubyClass(controllerClassName);
var controller = ConfigureController(controllerClass, requestContext);
Expand Down
8 changes: 5 additions & 3 deletions IronRubyMvc/Core/RubyEngine.cs
Expand Up @@ -236,8 +236,9 @@ public void ExecuteFile(string path, bool throwIfNotExist)
throw new FileNotFoundException("Can't find the file", path);

if (!PathProvider.FileExists(path)) return;

HandleError(() => Engine.ExecuteFile(PathProvider.MapPath(path), CurrentScope));

HandleError(() => Engine.ExecuteFile(PathProvider.MapPath(path), CurrentScope));
//HandleError(() => Engine.CreateOperations(CurrentScope).InvokeMember(null, "require", path));
}


Expand Down Expand Up @@ -289,7 +290,8 @@ public void LoadAssemblies(params Type[] assemblies)
/// <param name="path">The path.</param>
public void RequireRubyFile(string path)
{
Engine.RequireRubyFile(path);
//Engine.RequireRubyFile(path);
ExecuteScript("require '" + path.Replace("\\","/").Replace("~", string.Empty) + "'", CurrentScope);
}

/// <summary>
Expand Down

0 comments on commit bc80a30

Please sign in to comment.