Skip to content

Commit b643cec

Browse files
committed
Rename to PhpjsUtil
1 parent 2b5b847 commit b643cec

File tree

5 files changed

+13
-2035
lines changed

5 files changed

+13
-2035
lines changed

_tests/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ node cli.js -f ../functions/datetime/date.js
1010

1111
```html
1212
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
13-
<script src="phpjs.js"></script>
13+
<script src="phpjsutil.js"></script>
1414
<script type="text/javascript">
1515
// Get `code`
16-
Phpjs.parse(code, function (err, result) {
16+
PhpjsUtil.parse(code, function (err, result) {
1717
if (err) {
1818
$('#content').append('<pre class="alert-warning alert">' + JSON.stringify(err, undefined, 2) + '</pre>');
1919
}

_tests/cli.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var cli = require('cli').enable('status', 'help', 'version', 'glob', 'timeout');
22
var FS = require('fs');
3-
var phpjs = require('./phpjs');
3+
var PhpjsUtil = require('./phpjsutil');
44

55
cli.parse({
66
function_file: ['f', 'Function to test', 'path'],
@@ -19,13 +19,13 @@ cli.main(function(args, options) {
1919
return cli.fatal(err);
2020
}
2121

22-
phpjs.parse(options.function_file, code, function (err, params) {
22+
PhpjsUtil.parse(options.function_file, code, function (err, params) {
2323
if (err) {
2424
return cli.fatal(err);
2525
}
2626
// console.log(params['headKeys']);
2727

28-
phpjs.test(params, function(err, test, params) {
28+
PhpjsUtil.test(params, function(err, test, params) {
2929
var testline = params['name'] +
3030
'#' + test['number'] +
3131
'\t' + test['example'] +
@@ -40,5 +40,4 @@ cli.main(function(args, options) {
4040
});
4141
});
4242
});
43-
4443
});

_tests/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ <h1>php.js demo</h1>
1212
</div>
1313
</body>
1414

15-
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
16-
<script src="phpjs.js"></script>
1715

1816
<script type="text/javascript">
1917
var code = 'function strtotime (text, now) {\n' +
@@ -151,9 +149,9 @@ <h1>php.js demo</h1>
151149
</script>
152150

153151
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
154-
<script src="phpjs.js"></script>
152+
<script src="phpjsutil.js"></script>
155153
<script type="text/javascript">
156-
Phpjs.parse('strtotime', code, function (err, result) {
154+
PhpjsUtil.parse('strtotime', code, function (err, result) {
157155
if (err) {
158156
$('#content').append('<pre class="alert-warning alert">' + JSON.stringify(err, undefined, 2) + '</pre>');
159157
}

_tests/phpjs.js renamed to _tests/phpjsutil.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
if (typeof require !== 'undefined') {
2-
module.exports = Phpjs;
2+
module.exports = PhpjsUtil;
33
}
4-
function Phpjs () {
4+
function PhpjsUtil () {
55
}
66

7-
Phpjs._commentBlocks = function(code) {
7+
PhpjsUtil._commentBlocks = function(code) {
88
var cnt = 0;
99
var comment = [];
1010
var commentBlocks = [];
@@ -32,7 +32,7 @@ Phpjs._commentBlocks = function(code) {
3232
return commentBlocks;
3333
}
3434

35-
Phpjs._headKeys = function(headLines) {
35+
PhpjsUtil._headKeys = function(headLines) {
3636
var i;
3737
var keys = {};
3838
var match = [];
@@ -70,7 +70,7 @@ Phpjs._headKeys = function(headLines) {
7070
return keys;
7171
}
7272

73-
Phpjs.parse = function(name, code, cb) {
73+
PhpjsUtil.parse = function(name, code, cb) {
7474
var commentBlocks = this._commentBlocks(code);
7575
var head = commentBlocks[0].raw.join('\n');
7676
var body = code.replace(head, '');
@@ -87,7 +87,7 @@ Phpjs.parse = function(name, code, cb) {
8787
});
8888
};
8989

90-
Phpjs.test = function(params, cb) {
90+
PhpjsUtil.test = function(params, cb) {
9191
var i = 0;
9292
var j = 0;
9393

0 commit comments

Comments
 (0)