Skip to content

Instantly share code, notes, and snippets.

@earl
Created February 26, 2010 20:21
Show Gist options
  • Save earl/316112 to your computer and use it in GitHub Desktop.
Save earl/316112 to your computer and use it in GitHub Desktop.
diff --git a/modules/ringo/skin/macros.js b/modules/ringo/skin/macros.js
index db2573f..ded6e57 100644
--- a/modules/ringo/skin/macros.js
+++ b/modules/ringo/skin/macros.js
@@ -1,13 +1,14 @@
include('ringo/markdown');
require('core/string');
+var webappEnv = require('ringo/webapp/env');
exports.href_macro = function(tag) {
- var req = require('ringo/webapp/env').getRequest();
+ var req = webappEnv.getRequest();
return req.rootPath + (tag.parameters[0] || '');
};
exports.matchPath_macro = function(tag) {
- var req = require('ringo/webapp/env').getRequest();
+ var req = webappEnv.getRequest();
if (req && req.path &&
req.path.substring(req.rootPath.length).match(tag.parameters[0])) {
return tag.parameters[1] || "match";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment