Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0.5.25

  • Loading branch information...
commit 69ccbd63004c35e3f0a01abe56b46746c587ae66 2 parents ea9ba42 + 00f3f27
Vladimir Alaev scf2k authored
5 ChangeLog.md
View
@@ -1,5 +1,10 @@
bem-tools changelog
===================
+14.02.2013, Version 0.5.25 (stable)
+-----------------------------------
+
+- bem server: windows fixes
+
04.02.2013, Version 0.5.24 (stable)
-----------------------------------
2  lib/base-server.js
View
@@ -150,6 +150,8 @@ exports.Server = INHERIT({
relPath = QS.unescape(reqPath).replace(/^\/|\/$/g, ''),
fullPath = PATH.join(root, relPath);
+ if (PATH.dirSep === '\\') relPath = PATH.unixToOs(relPath);
+
LOGGER.fverbose('*** trying to access %s', fullPath);
// try to find node in arch
2  lib/nodes/lib.js
View
@@ -453,6 +453,6 @@ registry.decl(SvnLibraryNodeName, ScmLibraryNodeName, /** @lends SvnLibraryNode.
function joinUrlPath(url, part) {
var p = URL.parse(url);
- p.pathname = PATH.join(p.pathname, part);
+ p.pathname = PATH.joinPosix(p.pathname, part);
return URL.format(p);
}
52 lib/path.js
View
@@ -27,6 +27,58 @@ exports.unixToOs = function(path) {
return path.replace(/\//g, dirSep);
};
+exports.joinPosix = function() {
+ var paths = Array.prototype.slice.call(arguments, 0);
+ return exports.normalizePosix(paths.filter(function(p, index) {
+ return p && typeof p === 'string';
+ }).join('/'));
+};
+
+exports.normalizePosix = function(path) {
+ var isAbsolute = path.charAt(0) === '/',
+ trailingSlash = path.slice(-1) === '/';
+
+ // Normalize the path
+ path = normalizeArray(path.split('/').filter(function(p) {
+ return !!p;
+ }), !isAbsolute).join('/');
+
+ if (!path && !isAbsolute) {
+ path = '.';
+ }
+ if (path && trailingSlash) {
+ path += '/';
+ }
+
+ return (isAbsolute ? '/' : '') + path;
+};
+
// Support compatability with node 0.6.x and remove warnings on node 0.8.x
exports.exists = FS.exists || PATH.exists;
exports.existsSync = FS.existsSync || PATH.existsSync;
+
+function normalizeArray(parts, allowAboveRoot) {
+ // if the path tries to go above the root, `up` ends up > 0
+ var up = 0;
+ for (var i = parts.length - 1; i >= 0; i--) {
+ var last = parts[i];
+ if (last == '.') {
+ parts.splice(i, 1);
+ } else if (last === '..') {
+ parts.splice(i, 1);
+ up++;
+ } else if (up) {
+ parts.splice(i, 1);
+ up--;
+ }
+ }
+
+ // if the path is allowed to go above the root, restore leading ..s
+ if (allowAboveRoot) {
+ for (; up--; up) {
+ parts.unshift('..');
+ }
+ }
+
+ return parts;
+}
2  npm-shrinkwrap.json
View
@@ -1,6 +1,6 @@
{
"name": "bem",
- "version": "0.5.22",
+ "version": "0.5.25",
"dependencies": {
"coa": {
"version": "0.3.9"
2  package.json
View
@@ -1,7 +1,7 @@
{
"name": "bem",
"description": "BEM Tools",
- "version": "0.5.24",
+ "version": "0.5.25",
"homepage": "http://github.com/bem/bem-tools",
"author": "Sergey Berezhnoy <veged@mail.ru> (http://github.com/veged)",
"maintainers": [
Please sign in to comment.
Something went wrong with that request. Please try again.