Comparing version 0.0.3 to 0.0.4
@@ -39,3 +39,3 @@ var Command, createHandler, debug, exec, extend, fslib, parse, parseFile; | ||
src = "return''"; | ||
regex = /#(\w+)/g; | ||
regex = /#(\w+(:?\.\w+)*)/g; | ||
latestIndex = 0; | ||
@@ -55,2 +55,3 @@ placeholders = 0; | ||
} | ||
debug(src); | ||
return this._fn = new Function("_d", src); | ||
@@ -57,0 +58,0 @@ }; |
@@ -11,3 +11,3 @@ var exec, pathlib, util; | ||
var cmds; | ||
cmds = ['iptables -A INPUT -s 192.168.1.15 -p tcp --dport 8080 -j ACCEPT', 'iptables -A INPUT -s #source_ip -p tcp --dport 8080 -j ACCEPT', 'iptables -A PREROUTING -s #source_ip -p tcp --dport #port -j DNAT --to-destination 192.168.1.3:8080', 'iptables -A PREROUTING -s #source_ip -p tcp --dport #port -j DNAT --to-destination #destination']; | ||
cmds = ['iptables -A INPUT -s 192.168.1.15 -p tcp --dport 8080 -j ACCEPT', 'iptables -A INPUT -s #source_ip -p tcp --dport 8080 -j ACCEPT', 'iptables -A PREROUTING -s #source_ip -p tcp --dport #port -j DNAT --to-destination 192.168.1.3:8080', 'iptables -A PREROUTING -s #source_ip -p tcp --dport #port -j DNAT --to-destination #destination', 'Hello #user.name, son of #user.father.']; | ||
describe('Command', function() { | ||
@@ -50,2 +50,12 @@ describe('#constructor', function() { | ||
}); | ||
it('should subsitute nested placeholders ', function() { | ||
var command; | ||
command = new util.Command(cmds[4]); | ||
return command.toString({ | ||
user: { | ||
name: 'Gimli', | ||
father: 'Glóin' | ||
} | ||
}).should.eql('Hello Gimli, son of Glóin.'); | ||
}); | ||
return it('should output unsafe subsitution', function() { | ||
@@ -52,0 +62,0 @@ var command; |
{ | ||
"name": "shrvr", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Shell server", | ||
@@ -34,2 +34,3 @@ "bin": { | ||
"dependencies": { | ||
"body-parser": "^1.12.0", | ||
"debug": "^2.1.1", | ||
@@ -44,4 +45,5 @@ "express": "^4.11.2", | ||
"gulp-coffee": "^2.3.1", | ||
"gulp-util": "^3.0.3" | ||
"gulp-util": "^3.0.3", | ||
"gulp-header": "^1.2.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14460
326
5
5
+ Addedbody-parser@^1.12.0