├── Support ├── node_modules │ ├── .bin │ │ └── shjs │ ├── shelljs │ │ ├── .npmignore │ │ ├── test │ │ │ ├── .npmignore │ │ │ ├── resources │ │ │ │ ├── cp │ │ │ │ │ ├── a │ │ │ │ │ ├── b │ │ │ │ │ ├── dir_a │ │ │ │ │ │ └── z │ │ │ │ │ └── dir_b │ │ │ │ │ │ └── dir_b_a │ │ │ │ │ │ └── dir_b_a_a │ │ │ │ │ │ └── z │ │ │ │ ├── file1 │ │ │ │ ├── file2 │ │ │ │ ├── file1.js │ │ │ │ ├── file1.txt │ │ │ │ ├── file2.js │ │ │ │ ├── file2.txt │ │ │ │ ├── find │ │ │ │ │ ├── a │ │ │ │ │ ├── b │ │ │ │ │ ├── .hidden │ │ │ │ │ ├── dir1 │ │ │ │ │ │ ├── a_dir1 │ │ │ │ │ │ └── dir11 │ │ │ │ │ │ │ └── a_dir11 │ │ │ │ │ └── dir2 │ │ │ │ │ │ └── a_dir1 │ │ │ │ ├── issue44 │ │ │ │ │ └── main.js │ │ │ │ ├── ls │ │ │ │ │ ├── file1 │ │ │ │ │ ├── file2 │ │ │ │ │ ├── .hidden_file │ │ │ │ │ ├── a_dir │ │ │ │ │ │ ├── nada │ │ │ │ │ │ ├── .hidden_dir │ │ │ │ │ │ │ └── nada │ │ │ │ │ │ └── b_dir │ │ │ │ │ │ │ └── z │ │ │ │ │ ├── file1.js │ │ │ │ │ ├── file2.js │ │ │ │ │ ├── .hidden_dir │ │ │ │ │ │ └── nada │ │ │ │ │ └── filename(with)[chars$]^that.must+be-escaped │ │ │ │ ├── pushd │ │ │ │ │ ├── a │ │ │ │ │ │ └── dummy │ │ │ │ │ └── b │ │ │ │ │ │ └── c │ │ │ │ │ │ └── dummy │ │ │ │ ├── chmod │ │ │ │ │ ├── a │ │ │ │ │ │ └── b │ │ │ │ │ │ │ └── c │ │ │ │ │ │ │ └── .npmignore │ │ │ │ │ ├── b │ │ │ │ │ │ └── a │ │ │ │ │ │ │ └── b │ │ │ │ │ │ │ └── .npmignore │ │ │ │ │ ├── c │ │ │ │ │ │ └── a │ │ │ │ │ │ │ └── b │ │ │ │ │ │ │ └── .npmignore │ │ │ │ │ └── file1 │ │ │ │ ├── external │ │ │ │ │ └── node_script.js │ │ │ │ └── a.txt │ │ │ ├── env.js │ │ │ ├── tempdir.js │ │ │ ├── pwd.js │ │ │ ├── make.js │ │ │ ├── which.js │ │ │ ├── to.js │ │ │ ├── dirs.js │ │ │ ├── config.js │ │ │ ├── echo.js │ │ │ ├── cat.js │ │ │ ├── cd.js │ │ │ ├── sed.js │ │ │ ├── grep.js │ │ │ ├── find.js │ │ │ ├── test.js │ │ │ ├── mkdir.js │ │ │ ├── exec.js │ │ │ ├── popd.js │ │ │ ├── chmod.js │ │ │ ├── mv.js │ │ │ ├── cp.js │ │ │ ├── rm.js │ │ │ └── pushd.js │ │ ├── jshint.json │ │ ├── .travis.yml │ │ ├── .documentup.json │ │ ├── global.js │ │ ├── scripts │ │ │ ├── docs.js │ │ │ └── run-tests.js │ │ ├── make.js │ │ ├── bin │ │ │ └── shjs │ │ └── LICENSE │ ├── underscore │ │ ├── CNAME │ │ ├── .npmignore │ │ ├── index.js │ │ ├── .travis.yml │ │ ├── favicon.ico │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ └── package.json │ ├── cli │ │ ├── index.js │ │ ├── node_modules │ │ │ └── glob │ │ │ │ ├── .npmignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── node_modules │ │ │ │ └── inherits │ │ │ │ │ ├── inherits.js │ │ │ │ │ ├── test.js │ │ │ │ │ ├── inherits_browser.js │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ └── package.json │ │ │ │ ├── examples │ │ │ │ ├── usr-local.js │ │ │ │ └── g.js │ │ │ │ ├── test │ │ │ │ ├── zz-cleanup.js │ │ │ │ ├── globstar-match.js │ │ │ │ ├── stat.js │ │ │ │ ├── root-nomount.js │ │ │ │ ├── root.js │ │ │ │ ├── cwd-test.js │ │ │ │ ├── bash-comparison.js │ │ │ │ ├── mark.js │ │ │ │ ├── pause-resume.js │ │ │ │ ├── nocase-nomagic.js │ │ │ │ └── 00-setup.js │ │ │ │ └── LICENSE │ │ ├── examples │ │ │ ├── glob.js │ │ │ ├── spinner.js │ │ │ ├── progress.js │ │ │ ├── cat.js │ │ │ ├── sort.js │ │ │ ├── command.js │ │ │ ├── static.coffee │ │ │ ├── static.js │ │ │ ├── long_desc.js │ │ │ └── echo.js │ │ ├── README.md │ │ └── package.json │ ├── minimatch │ │ ├── node_modules │ │ │ ├── lru-cache │ │ │ │ ├── .npmignore │ │ │ │ ├── AUTHORS │ │ │ │ ├── bench.js │ │ │ │ ├── test │ │ │ │ │ ├── memory-leak.js │ │ │ │ │ └── foreach.js │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── package.json │ │ │ │ └── lib │ │ │ │ │ └── lru-cache.js │ │ │ └── sigmund │ │ │ │ ├── test │ │ │ │ └── basic.js │ │ │ │ ├── sigmund.js │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ └── package.json │ │ ├── test │ │ │ ├── caching.js │ │ │ └── brace-expand.js │ │ ├── LICENSE │ │ ├── package.json │ │ └── README.md │ └── console-browserify │ │ ├── .travis.yml │ │ ├── .npmignore │ │ ├── test │ │ ├── static │ │ │ ├── index.html │ │ │ └── test-adapter.js │ │ └── index.js │ │ ├── .testem.json │ │ ├── README.md │ │ ├── LICENCE │ │ ├── index.js │ │ └── package.json ├── close-window.applescript ├── state.js ├── jshint_options.js ├── reg.js ├── package.json ├── output.html ├── style.js └── jshint-tm.js ├── .gitignore ├── info.plist ├── data └── ascii-identifier-data.js ├── Commands ├── Save without Hint.tmCommand ├── Hint.tmCommand └── Save and Hint.tmCommand └── README.md /Support/node_modules/.bin/shjs: -------------------------------------------------------------------------------- 1 | ../shelljs/bin/shjs -------------------------------------------------------------------------------- /Support/node_modules/shelljs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/.npmignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | 3 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/cp/a: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/cp/b: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/file1: -------------------------------------------------------------------------------- 1 | test1 -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/file2: -------------------------------------------------------------------------------- 1 | test2 -------------------------------------------------------------------------------- /Support/node_modules/underscore/CNAME: -------------------------------------------------------------------------------- 1 | underscorejs.org 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/cp/dir_a/z: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/file1.js: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/file1.txt: -------------------------------------------------------------------------------- 1 | test1 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/file2.js: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/file2.txt: -------------------------------------------------------------------------------- 1 | test2 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/find/a: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/find/b: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/issue44/main.js: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/file1: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/file2: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/pushd/a/dummy: -------------------------------------------------------------------------------- 1 | meh -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/pushd/b/c/dummy: -------------------------------------------------------------------------------- 1 | meh -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/find/.hidden: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/.hidden_file: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/a_dir/nada: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/file1.js: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/file2.js: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /Support/node_modules/cli/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./cli'); 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/find/dir1/a_dir1: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/find/dir2/a_dir1: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/.hidden_dir/nada: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada: -------------------------------------------------------------------------------- 1 | nada -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .DS_Store 3 | Support/node_modules 4 | Support/npm-debug.log -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/.npmignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | test/a/ 3 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | Rakefile 3 | docs/ 4 | raw/ 5 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./underscore'); 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/jshint.json: -------------------------------------------------------------------------------- 1 | { 2 | "loopfunc": true, 3 | "sub": true 4 | } -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped: -------------------------------------------------------------------------------- 1 | asdf 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 4 | - 0.8 5 | 6 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | - 0.9 5 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/external/node_script.js: -------------------------------------------------------------------------------- 1 | console.log('node_script_1234'); 2 | 3 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inherits 2 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/.documentup.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ShellJS", 3 | "twitter": [ 4 | "r2r" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/chmod/file1: -------------------------------------------------------------------------------- 1 | this is test file 1 2 | default state should be 0644 (rw-r--r--) 3 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | notifications: 5 | email: false 6 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/global.js: -------------------------------------------------------------------------------- 1 | var shell = require('./shell.js'); 2 | for (var cmd in shell) 3 | global[cmd] = shell[cmd]; 4 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fgnass/jshint.tmbundle/HEAD/Support/node_modules/underscore/favicon.ico -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/resources/a.txt: -------------------------------------------------------------------------------- 1 | This is line one 2 | This is line two 3 | 4 | This is line four 5 | . 6 | . 7 | More content here 8 | . 9 | . 10 | 11 | This is line eleven 12 | -------------------------------------------------------------------------------- /Support/close-window.applescript: -------------------------------------------------------------------------------- 1 | on run argv 2 | set window_name to item 1 of argv 3 | try 4 | tell application "TextMate" to close window named window_name 5 | on error number -1728 6 | end try 7 | end run -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/glob.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli').enable('glob'); 4 | 5 | //Running `./glob.js *.js` will output a list of .js files in this directory 6 | console.log(cli.args); -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/spinner.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli'); 4 | 5 | cli.spinner('Working..'); 6 | 7 | setTimeout(function () { 8 | cli.spinner('Working.. done!', true); //End the spinner 9 | }, 3000); -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .monitor 3 | .*.swp 4 | .nodemonignore 5 | releases 6 | *.log 7 | *.err 8 | fleet.json 9 | public/browserify 10 | bin/*.json 11 | .bin 12 | build 13 | compile 14 | .lock-wscript 15 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/progress.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli'); 4 | 5 | var i = 0, interval = setInterval(function () { 6 | cli.progress(++i / 100); 7 | if (i === 100) { 8 | clearInterval(interval); 9 | cli.ok('Finished!'); 10 | } 11 | }, 50); -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/examples/usr-local.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "{./*/*,/*,/usr/local/*}" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/examples/g.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "test/a/**/[cg]/../[cg]" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/zz-cleanup.js: -------------------------------------------------------------------------------- 1 | // remove the fixtures 2 | var tap = require("tap") 3 | , rimraf = require("rimraf") 4 | , path = require("path") 5 | 6 | tap.test("cleanup fixtures", function (t) { 7 | rimraf(path.resolve(__dirname, "a"), function (er) { 8 | t.ifError(er, "removed") 9 | t.end() 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/test/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TAPE Example 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/AUTHORS: -------------------------------------------------------------------------------- 1 | # Authors, sorted by whether or not they are me 2 | Isaac Z. Schlueter 3 | Carlos Brito Lage 4 | Marko Mikulicic 5 | Trent Mick 6 | Kevin O'Hara 7 | Marco Rogers 8 | Jesse Dailey 9 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/.testem.json: -------------------------------------------------------------------------------- 1 | { 2 | "launchers": { 3 | "node": { 4 | "command": "npm test" 5 | } 6 | }, 7 | "src_files": [ 8 | "./**/*.js" 9 | ], 10 | "before_tests": "npm run build", 11 | "on_exit": "rm test/static/bundle.js", 12 | "test_page": "test/static/index.html", 13 | "launch_in_dev": ["node", "phantomjs"] 14 | } 15 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/cat.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli'); 4 | 5 | var output_file = function (file) { 6 | cli.withInput(file, function (line, sep, eof) { 7 | if (!eof) { 8 | cli.output(line + sep); 9 | } else if (cli.args.length) { 10 | output_file(cli.args.shift()); 11 | } 12 | }); 13 | }; 14 | 15 | if (cli.args.length) { 16 | output_file(cli.args.shift()); 17 | } -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/env.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'); 4 | 5 | shell.config.silent = true; 6 | 7 | shell.rm('-rf', 'tmp'); 8 | shell.mkdir('tmp'); 9 | 10 | // 11 | // Valids 12 | // 13 | 14 | assert.equal(shell.env['PATH'], process.env['PATH']); 15 | 16 | shell.env['SHELLJS_TEST'] = 'hello world'; 17 | assert.equal(shell.env['SHELLJS_TEST'], process.env['SHELLJS_TEST']); 18 | 19 | shell.exit(123); 20 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/scripts/docs.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../global'); 3 | 4 | echo('Appending docs to README.md'); 5 | 6 | cd(__dirname + '/..'); 7 | 8 | // Extract docs from shell.js 9 | var docs = grep('//@', 'shell.js'); 10 | // Remove '//@' 11 | docs = docs.replace(/\/\/\@ ?/g, ''); 12 | // Append docs to README 13 | sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); 14 | 15 | echo('All done.'); 16 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/test/caching.js: -------------------------------------------------------------------------------- 1 | var Minimatch = require("../minimatch.js").Minimatch 2 | var tap = require("tap") 3 | tap.test("cache test", function (t) { 4 | var mm1 = new Minimatch("a?b") 5 | var mm2 = new Minimatch("a?b") 6 | t.equal(mm1, mm2, "should get the same object") 7 | // the lru should drop it after 100 entries 8 | for (var i = 0; i < 100; i ++) { 9 | new Minimatch("a"+i) 10 | } 11 | mm2 = new Minimatch("a?b") 12 | t.notEqual(mm1, mm2, "cache should have dropped") 13 | t.end() 14 | }) 15 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/sort.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli'); 4 | 5 | var options = cli.parse({ 6 | numeric: ['n', 'Compare using a numeric sort'], 7 | reverse: ['r', 'Reverse the results'] 8 | }); 9 | 10 | cli.withStdinLines(function (lines, newline) { 11 | lines.sort(!options.numeric ? null : function (a, b) { 12 | return parseInt(a) > parseInt(b); 13 | }); 14 | if (options.reverse) { 15 | lines.reverse(); 16 | } 17 | this.output(lines.join(newline)); 18 | }); -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | JavaScript JSHint 7 | description 8 | Runs JSHint upon save. Pretty UI, Requires Node.js. 9 | contactEmailRot13 10 | fgnass@gmail.com 11 | contactName 12 | Felix Gnass 13 | uuid 14 | EC121F15-2F76-464C-92D3-0C7999CB35BD 15 | 16 | 17 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/command.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli'); 4 | 5 | //The second (optional) argument of cli.parse() is a command list 6 | //Type `./command.js --help` for usage info 7 | 8 | //cli enables auto-completion of commands (similiar to npm), e.g. all of 9 | //the following are equivalent and result in "Command is: install": 10 | // $ ./command.js install 11 | // $ ./command.js inst 12 | // $ ./command.js i 13 | 14 | cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']); 15 | 16 | console.log('Command is: ' + cli.command); 17 | -------------------------------------------------------------------------------- /Support/state.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var state = { 4 | syntax: {}, 5 | 6 | reset: function () { 7 | this.tokens = { 8 | prev: null, 9 | next: null, 10 | curr: null 11 | }; 12 | 13 | this.option = {}; 14 | this.ignored = {}; 15 | this.directive = {}; 16 | this.jsonMode = false; 17 | this.jsonWarnings = []; 18 | this.lines = []; 19 | this.tab = ""; 20 | this.cache = {}; // Node.JS doesn't have Map. Sniff. 21 | this.ignoreLinterErrors = false; // Blank out non-multi-line-commented 22 | // lines when ignoring linter errors 23 | } 24 | }; 25 | 26 | exports.state = state; 27 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/bench.js: -------------------------------------------------------------------------------- 1 | var LRU = require('lru-cache'); 2 | 3 | var max = +process.argv[2] || 10240; 4 | var more = 102400; 5 | 6 | var cache = LRU({ 7 | max: max, maxAge: 86400e3 8 | }); 9 | 10 | // fill cache 11 | for (var i = 0; i < max; ++i) { 12 | cache.set(i, {}); 13 | } 14 | 15 | var start = process.hrtime(); 16 | 17 | // adding more items 18 | for ( ; i < max+more; ++i) { 19 | cache.set(i, {}); 20 | } 21 | 22 | var end = process.hrtime(start); 23 | var msecs = end[0] * 1E3 + end[1] / 1E6; 24 | 25 | console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); 26 | -------------------------------------------------------------------------------- /data/ascii-identifier-data.js: -------------------------------------------------------------------------------- 1 | var identifierStartTable = []; 2 | 3 | for (var i = 0; i < 128; i++) { 4 | identifierStartTable[i] = 5 | i === 36 || // $ 6 | i >= 65 && i <= 90 || // A-Z 7 | i === 95 || // _ 8 | i >= 97 && i <= 122; // a-z 9 | } 10 | 11 | var identifierPartTable = []; 12 | 13 | for (var i = 0; i < 128; i++) { 14 | identifierPartTable[i] = 15 | identifierStartTable[i] || // $, _, A-Z, a-z 16 | i >= 48 && i <= 57; // 0-9 17 | } 18 | 19 | module.exports = { 20 | asciiIdentifierStartTable: identifierStartTable, 21 | asciiIdentifierPartTable: identifierPartTable 22 | }; 23 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/globstar-match.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../glob.js").Glob 2 | var test = require('tap').test 3 | 4 | test('globstar should not have dupe matches', function(t) { 5 | var pattern = 'a/**/[gh]' 6 | var g = new Glob(pattern, { cwd: __dirname }) 7 | var matches = [] 8 | g.on('match', function(m) { 9 | console.error('match %j', m) 10 | matches.push(m) 11 | }) 12 | g.on('end', function(set) { 13 | console.error('set', set) 14 | matches = matches.sort() 15 | set = set.sort() 16 | t.same(matches, set, 'should have same set of matches') 17 | t.end() 18 | }) 19 | }) 20 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/tempdir.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Valids 21 | // 22 | 23 | var tmp = shell.tempdir(); 24 | assert.equal(shell.error(), null); 25 | assert.equal(fs.existsSync(tmp), true); 26 | 27 | shell.exit(123); 28 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/pwd.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'); 5 | 6 | shell.config.silent = true; 7 | 8 | function numLines(str) { 9 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 10 | } 11 | 12 | shell.rm('-rf', 'tmp'); 13 | shell.mkdir('tmp'); 14 | 15 | // 16 | // Valids 17 | // 18 | 19 | var _pwd = shell.pwd(); 20 | assert.equal(shell.error(), null); 21 | assert.equal(_pwd, path.resolve('.')); 22 | 23 | shell.cd('tmp'); 24 | var _pwd = shell.pwd(); 25 | assert.equal(shell.error(), null); 26 | assert.equal(path.basename(_pwd), 'tmp'); 27 | 28 | shell.exit(123); 29 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/node_modules/inherits/test.js: -------------------------------------------------------------------------------- 1 | var inherits = require('./inherits.js') 2 | var assert = require('assert') 3 | 4 | function test(c) { 5 | assert(c.constructor === Child) 6 | assert(c.constructor.super_ === Parent) 7 | assert(Object.getPrototypeOf(c) === Child.prototype) 8 | assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) 9 | assert(c instanceof Child) 10 | assert(c instanceof Parent) 11 | } 12 | 13 | function Child() { 14 | Parent.call(this) 15 | test(this) 16 | } 17 | 18 | function Parent() {} 19 | 20 | inherits(Child, Parent) 21 | 22 | var c = new Child 23 | test(c) 24 | 25 | console.log('ok') 26 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute to Underscore.js 2 | 3 | * Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. 4 | 5 | * Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). 6 | 7 | * Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). 8 | 9 | * In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. 10 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/README.md: -------------------------------------------------------------------------------- 1 | # console-browserify 2 | 3 | [![build status][1]][2] 4 | 5 | [![browser support][3]][4] 6 | 7 | Emulate console for all the browsers 8 | 9 | ## Example 10 | 11 | ```js 12 | var console = require("console-browserify") 13 | 14 | console.log("hello world!") 15 | ``` 16 | 17 | ## Installation 18 | 19 | `npm install console-browserify` 20 | 21 | ## Contributors 22 | 23 | - Raynos 24 | 25 | ## MIT Licenced 26 | 27 | 28 | 29 | [1]: https://secure.travis-ci.org/Raynos/console-browserify.png 30 | [2]: http://travis-ci.org/Raynos/console-browserify 31 | [3]: http://ci.testling.com/Raynos/console-browserify.png 32 | [4]: http://ci.testling.com/Raynos/console-browserify 33 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/make.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'), 2 | child = require('child_process'), 3 | assert = require('assert'); 4 | 5 | shell.mkdir('-p', 'tmp'); 6 | var file = 'tmp/tempscript'+Math.random()+'.js', 7 | script = 'require(\'../../make.js\');' + 8 | 'target.all=function(){' + 9 | ' echo("first"); '+ 10 | ' cp("this_file_doesnt_exist", ".");' + 11 | ' echo("second");' + 12 | '}'; 13 | 14 | script.to(file); 15 | child.exec('node '+file, function(err, stdout, stderr) { 16 | assert.ok(stdout.match('first')); 17 | assert.ok(!stdout.match('second')); // Make should die on errors, so this should never get echoed 18 | 19 | shell.exit(123); 20 | }); 21 | -------------------------------------------------------------------------------- /Commands/Save without Hint.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | # Do nothing, just save the active file 9 | input 10 | none 11 | keyEquivalent 12 | @S 13 | name 14 | Save without Hint 15 | output 16 | discard 17 | scope 18 | source.js 19 | uuid 20 | 7D2559CA-2963-4C26-B054-B32C0A6F4554 21 | 22 | 23 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/static.coffee: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env coffee 2 | 3 | cli = require 'cli' 4 | 5 | cli.enable('daemon','status') 6 | .setUsage('static.coffee [OPTIONS]') 7 | 8 | cli.parse { 9 | log: ['l', 'Enable logging'] 10 | port: ['p', 'Listen on this port', 'number', 8080] 11 | serve: [false, 'Serve static files from PATH', 'path', './public'] 12 | } 13 | 14 | middleware = [] 15 | 16 | cli.main (args, options) -> 17 | 18 | if options.log 19 | @debug 'Enabling logging' 20 | middleware.push require('creationix/log')() 21 | 22 | @debug 'Serving files from ' + options.serve 23 | middleware.push require('creationix/static')('/', options.serve, 'index.html') 24 | 25 | server = @createServer(middleware).listen options.port 26 | 27 | @ok 'Listening on port ' + options.port -------------------------------------------------------------------------------- /Support/node_modules/minimatch/test/brace-expand.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | , minimatch = require("../") 3 | 4 | tap.test("brace expansion", function (t) { 5 | // [ pattern, [expanded] ] 6 | ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" 7 | , [ "abxy" 8 | , "abxz" 9 | , "acdxy" 10 | , "acdxz" 11 | , "acexy" 12 | , "acexz" 13 | , "afhxy" 14 | , "afhxz" 15 | , "aghxy" 16 | , "aghxz" ] ] 17 | , [ "a{1..5}b" 18 | , [ "a1b" 19 | , "a2b" 20 | , "a3b" 21 | , "a4b" 22 | , "a5b" ] ] 23 | , [ "a{b}c", ["a{b}c"] ] 24 | ].forEach(function (tc) { 25 | var p = tc[0] 26 | , expect = tc[1] 27 | t.equivalent(minimatch.braceExpand(p), expect, p) 28 | }) 29 | console.error("ending") 30 | t.end() 31 | }) 32 | 33 | 34 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/sigmund/test/basic.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var sigmund = require('../sigmund.js') 3 | 4 | 5 | // occasionally there are duplicates 6 | // that's an acceptable edge-case. JSON.stringify and util.inspect 7 | // have some collision potential as well, though less, and collision 8 | // detection is expensive. 9 | var hash = '{abc/def/g{0h1i2{jkl' 10 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 11 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 12 | 13 | var obj3 = JSON.parse(JSON.stringify(obj1)) 14 | obj3.c = /def/ 15 | obj3.g[2].cycle = obj3 16 | var cycleHash = '{abc/def/g{0h1i2{jklcycle' 17 | 18 | test('basic', function (t) { 19 | t.equal(sigmund(obj1), hash) 20 | t.equal(sigmund(obj2), hash) 21 | t.equal(sigmund(obj3), cycleHash) 22 | t.end() 23 | }) 24 | 25 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/static.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('cli').enable('status', 'daemon'); 4 | 5 | cli.parse({ 6 | log: ['l', 'Enable logging'], 7 | port: ['p', 'Listen on this port', 'number', 8080], 8 | serve: [false, 'Serve static files from PATH', 'path', './public'] 9 | }); 10 | 11 | cli.main(function (args, options) { 12 | var server, middleware = []; 13 | 14 | if (options.log) { 15 | this.debug('Enabling logging'); 16 | middleware.push(require('creationix/log')()); 17 | } 18 | 19 | this.debug('Serving files from ' + options.serve); 20 | middleware.push(require('creationix/static')('/', options.serve, 'index.html')); 21 | 22 | server = this.createServer(middleware).listen(options.port); 23 | 24 | this.ok('Listening on port ' + options.port); 25 | }); -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/which.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Invalids 21 | // 22 | 23 | shell.which(); 24 | assert.ok(shell.error()); 25 | 26 | var result = shell.which('asdfasdfasdfasdfasdf'); // what are the odds... 27 | assert.equal(shell.error(), null); 28 | assert.equal(result, null); 29 | 30 | // 31 | // Valids 32 | // 33 | 34 | var result = shell.which('node'); 35 | assert.equal(shell.error(), null); 36 | assert.equal(fs.existsSync(result), true); 37 | 38 | shell.exit(123); 39 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/to.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Invalids 21 | // 22 | 23 | 'hello world'.to(); 24 | assert.ok(shell.error()); 25 | 26 | assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check 27 | 'hello world'.to('/asdfasdf/file'); 28 | assert.ok(shell.error()); 29 | 30 | // 31 | // Valids 32 | // 33 | 34 | 'hello world'.to('tmp/to1'); 35 | var result = shell.cat('tmp/to1'); 36 | assert.equal(shell.error(), null); 37 | assert.equal(result, 'hello world'); 38 | 39 | shell.exit(123); 40 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/stat.js: -------------------------------------------------------------------------------- 1 | var glob = require('../') 2 | var test = require('tap').test 3 | var path = require('path') 4 | 5 | test('stat all the things', function(t) { 6 | var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) 7 | var matches = [] 8 | g.on('match', function(m) { 9 | matches.push(m) 10 | }) 11 | var stats = [] 12 | g.on('stat', function(m) { 13 | stats.push(m) 14 | }) 15 | g.on('end', function(eof) { 16 | stats = stats.sort() 17 | matches = matches.sort() 18 | eof = eof.sort() 19 | t.same(stats, matches) 20 | t.same(eof, matches) 21 | var cache = Object.keys(this.statCache) 22 | t.same(cache.map(function (f) { 23 | return path.relative(__dirname, f) 24 | }).sort(), matches) 25 | 26 | cache.forEach(function(c) { 27 | t.equal(typeof this.statCache[c], 'object') 28 | }, this) 29 | 30 | t.end() 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/dirs.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | var root = path.resolve(); 13 | 14 | shell.pushd('resources/pushd'); 15 | shell.pushd('a'); 16 | 17 | var trail = [ 18 | path.resolve(root, 'resources/pushd/a'), 19 | path.resolve(root, 'resources/pushd'), 20 | root 21 | ]; 22 | 23 | assert.deepEqual(shell.dirs(), trail); 24 | 25 | // Single items 26 | assert.equal(shell.dirs('+0'), trail[0]); 27 | assert.equal(shell.dirs('+1'), trail[1]); 28 | assert.equal(shell.dirs('+2'), trail[2]); 29 | assert.equal(shell.dirs('-0'), trail[2]); 30 | assert.equal(shell.dirs('-1'), trail[1]); 31 | assert.equal(shell.dirs('-2'), trail[0]); 32 | 33 | // Clearing items 34 | assert.deepEqual(shell.dirs('-c'), []); 35 | assert(!shell.error()); 36 | 37 | shell.exit(123); -------------------------------------------------------------------------------- /Commands/Hint.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env node 9 | var env = process.env || process.ENV, 10 | jshint = require(env.TM_BUNDLE_SUPPORT + '/jshint-tm'), 11 | jshint_options = require(env.TM_BUNDLE_SUPPORT + '/jshint_options')(); 12 | 13 | jshint(jshint_options); 14 | input 15 | document 16 | inputFormat 17 | text 18 | keyEquivalent 19 | ^L 20 | name 21 | Hint 22 | outputFormat 23 | html 24 | outputLocation 25 | newWindow 26 | scope 27 | source.js 28 | uuid 29 | fc33ecd0-172f-11e3-8ffd-0800200c9a66 30 | 31 | 32 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/long_desc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var cli = require('../'); 4 | 5 | //You can (optionally) boost the width of output with: 6 | //cli.width = 120; 7 | 8 | //You can also adjust the width of the options/command definitions 9 | //cli.option_width = 25; 10 | 11 | var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s ' 12 | + 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make' 13 | + ' a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, ' 14 | + 'remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing ' 15 | + 'Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions' 16 | + ' of Lorem Ipsum.'; 17 | 18 | cli.parse({ 19 | foo: ['f', long_desc] 20 | }); 21 | -------------------------------------------------------------------------------- /Commands/Save and Hint.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env node 9 | var env = process.env || process.ENV, 10 | jshint = require(env.TM_BUNDLE_SUPPORT + '/jshint-tm'), 11 | jshint_options = require(env.TM_BUNDLE_SUPPORT + '/jshint_options')(); 12 | 13 | jshint(jshint_options); 14 | input 15 | none 16 | keyEquivalent 17 | @s 18 | name 19 | Save & Hint 20 | outputFormat 21 | html 22 | outputLocation 23 | newWindow 24 | scope 25 | source.js 26 | uuid 27 | 0048A010-05A0-4A0E-BF97-793A3BA4617D 28 | version 29 | 2 30 | 31 | 32 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Raynos. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node --expose_gc 2 | 3 | var weak = require('weak'); 4 | var test = require('tap').test 5 | var LRU = require('../') 6 | var l = new LRU({ max: 10 }) 7 | var refs = 0 8 | function X() { 9 | refs ++ 10 | weak(this, deref) 11 | } 12 | 13 | function deref() { 14 | refs -- 15 | } 16 | 17 | test('no leaks', function (t) { 18 | // fill up the cache 19 | for (var i = 0; i < 100; i++) { 20 | l.set(i, new X); 21 | // throw some gets in there, too. 22 | if (i % 2 === 0) 23 | l.get(i / 2) 24 | } 25 | 26 | gc() 27 | 28 | var start = process.memoryUsage() 29 | 30 | // capture the memory 31 | var startRefs = refs 32 | 33 | // do it again, but more 34 | for (var i = 0; i < 10000; i++) { 35 | l.set(i, new X); 36 | // throw some gets in there, too. 37 | if (i % 2 === 0) 38 | l.get(i / 2) 39 | } 40 | 41 | gc() 42 | 43 | var end = process.memoryUsage() 44 | t.equal(refs, startRefs, 'no leaky refs') 45 | 46 | console.error('start: %j\n' + 47 | 'end: %j', start, end); 48 | t.pass(); 49 | t.end(); 50 | }) 51 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/README.md: -------------------------------------------------------------------------------- 1 | __ 2 | /\ \ __ 3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ 4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ 5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ 6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ 7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ 8 | \ \____/ 9 | \/___/ 10 | 11 | Underscore.js is a utility-belt library for JavaScript that provides 12 | support for the usual functional suspects (each, map, reduce, filter...) 13 | without extending any core JavaScript objects. 14 | 15 | For Docs, License, Tests, and pre-packed downloads, see: 16 | http://underscorejs.org 17 | 18 | Many thanks to our contributors: 19 | https://github.com/documentcloud/underscore/contributors 20 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/root-nomount.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing root and searching for /b*/**", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('root=a, cwd=a/b', function (t) { 26 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('cd -', function (t) { 34 | process.chdir(origCwd) 35 | t.end() 36 | }) 37 | 38 | t.end() 39 | }) 40 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/make.js: -------------------------------------------------------------------------------- 1 | require('./global'); 2 | config.fatal = true; 3 | 4 | global.target = {}; 5 | 6 | // This ensures we only execute the script targets after the entire script has 7 | // been evaluated 8 | var args = process.argv.slice(2); 9 | setTimeout(function() { 10 | var t; 11 | 12 | if (args.length === 1 && args[0] === '--help') { 13 | console.log('Available targets:'); 14 | for (t in target) 15 | console.log(' ' + t); 16 | return; 17 | } 18 | 19 | // Wrap targets to prevent duplicate execution 20 | for (t in target) { 21 | (function(t, oldTarget){ 22 | 23 | // Wrap it 24 | target[t] = function(force) { 25 | if (oldTarget.done && !force) 26 | return; 27 | oldTarget.done = true; 28 | return oldTarget.apply(oldTarget, arguments); 29 | }; 30 | 31 | })(t, target[t]); 32 | } 33 | 34 | // Execute desired targets 35 | if (args.length > 0) { 36 | args.forEach(function(arg) { 37 | if (arg in target) 38 | target[arg](); 39 | else { 40 | console.log('no such target: ' + arg); 41 | exit(1); 42 | } 43 | }); 44 | } else if ('all' in target) { 45 | target.all(); 46 | } 47 | 48 | }, 0); 49 | -------------------------------------------------------------------------------- /Support/jshint_options.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var env = process.env || process.ENV; 3 | 4 | module.exports = function() { 5 | var default_options = { 6 | "forin": true, 7 | "predef": [ 8 | // CommonJS 9 | "exports", 10 | "require", 11 | "module", 12 | // NodeJS 13 | "GLOBAL", 14 | "process", 15 | "__filename", 16 | "__dirname" 17 | ] 18 | }; 19 | 20 | var current_dir = env.TM_DIRECTORY; 21 | var project_dir = env.TM_PROJECT_DIRECTORY; 22 | var home_dir = env.HOME; 23 | var options; 24 | 25 | function readCustomOptions(path) { 26 | if (fs.existsSync(path)) { 27 | return JSON.parse(fs.readFileSync(path, 'utf8')); 28 | } else { 29 | return false; 30 | } 31 | } 32 | 33 | if (current_dir) { 34 | options = readCustomOptions(current_dir + '/.jshintrc'); 35 | if (options) return options; 36 | } 37 | 38 | if (project_dir) { 39 | options = readCustomOptions(project_dir + '/.jshintrc'); 40 | if (options) return options; 41 | } 42 | 43 | if (home_dir) { 44 | options = readCustomOptions(home_dir + '/.jshintrc'); 45 | if (options) return options; 46 | } 47 | 48 | return default_options; 49 | }; 50 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/scripts/run-tests.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../global'); 3 | 4 | var path = require('path'); 5 | 6 | var failed = false; 7 | 8 | // 9 | // Lint 10 | // 11 | JSHINT_BIN = './node_modules/jshint/bin/jshint'; 12 | cd(__dirname + '/..'); 13 | 14 | if (!test('-f', JSHINT_BIN)) { 15 | echo('JSHint not found. Run `npm install` in the root dir first.'); 16 | exit(1); 17 | } 18 | 19 | if (exec(JSHINT_BIN + ' --config jshint.json *.js test/*.js').code !== 0) { 20 | failed = true; 21 | echo('*** JSHINT FAILED! (return code != 0)'); 22 | echo(); 23 | } else { 24 | echo('All JSHint tests passed'); 25 | echo(); 26 | } 27 | 28 | // 29 | // Unit tests 30 | // 31 | cd(__dirname + '/../test'); 32 | ls('*.js').forEach(function(file) { 33 | echo('Running test:', file); 34 | if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit) 35 | failed = true; 36 | echo('*** TEST FAILED! (missing exit code "123")'); 37 | echo(); 38 | } 39 | }); 40 | 41 | if (failed) { 42 | echo(); 43 | echo('*******************************************************'); 44 | echo('WARNING: Some tests did not pass!'); 45 | echo('*******************************************************'); 46 | exit(1); 47 | } else { 48 | echo(); 49 | echo('All tests passed.'); 50 | } 51 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/test/foreach.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var LRU = require('../') 3 | 4 | test('forEach', function (t) { 5 | var l = new LRU(5) 6 | for (var i = 0; i < 10; i ++) { 7 | l.set(i.toString(), i.toString(2)) 8 | } 9 | 10 | var i = 9 11 | l.forEach(function (val, key, cache) { 12 | t.equal(cache, l) 13 | t.equal(key, i.toString()) 14 | t.equal(val, i.toString(2)) 15 | i -= 1 16 | }) 17 | 18 | // get in order of most recently used 19 | l.get(6) 20 | l.get(8) 21 | 22 | var order = [ 8, 6, 9, 7, 5 ] 23 | var i = 0 24 | 25 | l.forEach(function (val, key, cache) { 26 | var j = order[i ++] 27 | t.equal(cache, l) 28 | t.equal(key, j.toString()) 29 | t.equal(val, j.toString(2)) 30 | }) 31 | 32 | t.end() 33 | }) 34 | 35 | test('keys() and values()', function (t) { 36 | var l = new LRU(5) 37 | for (var i = 0; i < 10; i ++) { 38 | l.set(i.toString(), i.toString(2)) 39 | } 40 | 41 | t.similar(l.keys(), ['9', '8', '7', '6', '5']) 42 | t.similar(l.values(), ['1001', '1000', '111', '110', '101']) 43 | 44 | // get in order of most recently used 45 | l.get(6) 46 | l.get(8) 47 | 48 | t.similar(l.keys(), ['8', '6', '9', '7', '5']) 49 | t.similar(l.values(), ['1000', '110', '1001', '111', '101']) 50 | 51 | t.end() 52 | }) 53 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/root.js: -------------------------------------------------------------------------------- 1 | var t = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | var glob = require('../') 7 | var path = require('path') 8 | 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | 18 | t.test('a', function (t) { 19 | console.error("root=" + path.resolve('a')) 20 | glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { 21 | t.ifError(er) 22 | var wanted = [ 23 | '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' 24 | ].map(function (m) { 25 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 26 | }) 27 | 28 | t.like(matches, wanted) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('root=a, cwd=a/b', function (t) { 34 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { 37 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 38 | })) 39 | t.end() 40 | }) 41 | }) 42 | 43 | t.test('cd -', function (t) { 44 | process.chdir(origCwd) 45 | t.end() 46 | }) 47 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/sigmund/sigmund.js: -------------------------------------------------------------------------------- 1 | module.exports = sigmund 2 | function sigmund (subject, maxSessions) { 3 | maxSessions = maxSessions || 10; 4 | var notes = []; 5 | var analysis = ''; 6 | var RE = RegExp; 7 | 8 | function psychoAnalyze (subject, session) { 9 | if (session > maxSessions) return; 10 | 11 | if (typeof subject === 'function' || 12 | typeof subject === 'undefined') { 13 | return; 14 | } 15 | 16 | if (typeof subject !== 'object' || !subject || 17 | (subject instanceof RE)) { 18 | analysis += subject; 19 | return; 20 | } 21 | 22 | if (notes.indexOf(subject) !== -1 || session === maxSessions) return; 23 | 24 | notes.push(subject); 25 | analysis += '{'; 26 | Object.keys(subject).forEach(function (issue, _, __) { 27 | // pseudo-private values. skip those. 28 | if (issue.charAt(0) === '_') return; 29 | var to = typeof subject[issue]; 30 | if (to === 'function' || to === 'undefined') return; 31 | analysis += issue; 32 | psychoAnalyze(subject[issue], session + 1); 33 | }); 34 | } 35 | psychoAnalyze(subject, 0); 36 | return analysis; 37 | } 38 | 39 | // vim: set softtabstop=4 shiftwidth=4: 40 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/bin/shjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../global'); 3 | 4 | if (process.argv.length < 3) { 5 | console.log('ShellJS: missing argument (script name)'); 6 | console.log(); 7 | process.exit(1); 8 | } 9 | 10 | var args, 11 | scriptName = process.argv[2]; 12 | env['NODE_PATH'] = __dirname + '/../..'; 13 | 14 | if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { 15 | if (test('-f', scriptName + '.js')) 16 | scriptName += '.js'; 17 | if (test('-f', scriptName + '.coffee')) 18 | scriptName += '.coffee'; 19 | } 20 | 21 | if (!test('-f', scriptName)) { 22 | console.log('ShellJS: script not found ('+scriptName+')'); 23 | console.log(); 24 | process.exit(1); 25 | } 26 | 27 | args = process.argv.slice(3); 28 | 29 | for (var i = 0, l = args.length; i < l; i++) { 30 | if (args[i][0] !== "-"){ 31 | args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words 32 | } 33 | } 34 | 35 | if (scriptName.match(/\.coffee$/)) { 36 | // 37 | // CoffeeScript 38 | // 39 | if (which('coffee')) { 40 | exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); 41 | } else { 42 | console.log('ShellJS: CoffeeScript interpreter not found'); 43 | console.log(); 44 | process.exit(1); 45 | } 46 | } else { 47 | // 48 | // JavaScript 49 | // 50 | exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); 51 | } 52 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/sigmund/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/cwd-test.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing cwd and searching for **/d", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('**/d', function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ 'b/c/d', 'c/d' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('a/b', function (t) { 26 | glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ 'c/d' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('a/b/', function (t) { 34 | glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ 'c/d' ]) 37 | t.end() 38 | }) 39 | }) 40 | 41 | t.test('.', function (t) { 42 | glob('**/d', {cwd: process.cwd()}, function (er, matches) { 43 | t.ifError(er) 44 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 45 | t.end() 46 | }) 47 | }) 48 | 49 | t.test('cd -', function (t) { 50 | process.chdir(origCwd) 51 | t.end() 52 | }) 53 | 54 | t.end() 55 | }) 56 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/config.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | child = require('child_process'); 5 | 6 | function numLines(str) { 7 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 8 | } 9 | 10 | // 11 | // config.silent 12 | // 13 | 14 | assert.equal(shell.config.silent, false); // default 15 | 16 | shell.config.silent = true; 17 | assert.equal(shell.config.silent, true); 18 | 19 | shell.config.silent = false; 20 | assert.equal(shell.config.silent, false); 21 | 22 | // 23 | // config.fatal 24 | // 25 | 26 | assert.equal(shell.config.fatal, false); // default 27 | 28 | // 29 | // config.fatal = false 30 | // 31 | shell.mkdir('-p', 'tmp'); 32 | var file = 'tmp/tempscript'+Math.random()+'.js', 33 | script = 'require(\'../../global.js\'); config.silent=true; config.fatal=false; cp("this_file_doesnt_exist", "."); echo("got here");'; 34 | script.to(file); 35 | child.exec('node '+file, function(err, stdout, stderr) { 36 | assert.ok(stdout.match('got here')); 37 | 38 | // 39 | // config.fatal = true 40 | // 41 | shell.mkdir('-p', 'tmp'); 42 | var file = 'tmp/tempscript'+Math.random()+'.js', 43 | script = 'require(\'../../global.js\'); config.silent=true; config.fatal=true; cp("this_file_doesnt_exist", "."); echo("got here");'; 44 | script.to(file); 45 | child.exec('node '+file, function(err, stdout, stderr) { 46 | assert.ok(!stdout.match('got here')); 47 | 48 | shell.exit(123); 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /Support/reg.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Regular expressions. Some of these are stupidly long. 3 | */ 4 | 5 | /*jshint maxlen:1000 */ 6 | 7 | "use string"; 8 | 9 | // Unsafe comment or string (ax) 10 | exports.unsafeString = 11 | /@cc|<\/?|script|\]\s*\]|<\s*!|</i; 12 | 13 | // Unsafe characters that are silently deleted by one or more browsers (cx) 14 | exports.unsafeChars = 15 | /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; 16 | 17 | // Characters in strings that need escaping (nx and nxg) 18 | exports.needEsc = 19 | /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; 20 | 21 | exports.needEscGlobal = 22 | /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; 23 | 24 | // Star slash (lx) 25 | exports.starSlash = /\*\//; 26 | 27 | // Identifier (ix) 28 | exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; 29 | 30 | // JavaScript URL (jx) 31 | exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; 32 | 33 | // Catches /* falls through */ comments (ft) 34 | exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; 35 | 36 | // very conservative rule (eg: only one space between the start of the comment and the first character) 37 | // to relax the maxlen option 38 | exports.maxlenException = /^(?:(?:\/\/|\/\*|\*) ?)?[^ ]+$/; 39 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/echo.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'), 6 | child = require('child_process'); 7 | 8 | // Node shims for < v0.7 9 | fs.existsSync = fs.existsSync || path.existsSync; 10 | 11 | shell.config.silent = true; 12 | 13 | function numLines(str) { 14 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 15 | } 16 | 17 | shell.rm('-rf', 'tmp'); 18 | shell.mkdir('tmp'); 19 | 20 | // 21 | // Valids 22 | // 23 | 24 | 25 | // From here on we use child.exec() to intercept the stdout 26 | 27 | 28 | // simple test with defaults 29 | shell.mkdir('-p', 'tmp'); 30 | var file = 'tmp/tempscript'+Math.random()+'.js', 31 | script = 'require(\'../../global.js\'); echo("-asdf", "111");'; // test '-' bug (see issue #20) 32 | script.to(file); 33 | child.exec('node '+file, function(err, stdout, stderr) { 34 | assert.ok(stdout === '-asdf 111\n' || stdout === '-asdf 111\nundefined\n'); // 'undefined' for v0.4 35 | 36 | // simple test with silent(true) 37 | shell.mkdir('-p', 'tmp'); 38 | var file = 'tmp/tempscript'+Math.random()+'.js', 39 | script = 'require(\'../../global.js\'); config.silent=true; echo(555);'; 40 | script.to(file); 41 | child.exec('node '+file, function(err, stdout, stderr) { 42 | assert.ok(stdout === '555\n' || stdout === '555\nundefined\n'); // 'undefined' for v0.4 43 | 44 | theEnd(); 45 | }); 46 | }); 47 | 48 | function theEnd() { 49 | shell.exit(123); 50 | } 51 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/cat.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | // save current dir 17 | var cur = shell.pwd(); 18 | 19 | shell.rm('-rf', 'tmp'); 20 | shell.mkdir('tmp'); 21 | 22 | // 23 | // Invalids 24 | // 25 | 26 | shell.cat(); 27 | assert.ok(shell.error()); 28 | 29 | assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check 30 | shell.cat('/adsfasdf'); // file does not exist 31 | assert.ok(shell.error()); 32 | 33 | // 34 | // Valids 35 | // 36 | 37 | // simple 38 | var result = shell.cat('resources/file1'); 39 | assert.equal(shell.error(), null); 40 | assert.equal(result, 'test1'); 41 | 42 | // multiple files 43 | var result = shell.cat('resources/file2', 'resources/file1'); 44 | assert.equal(shell.error(), null); 45 | assert.equal(result, 'test2\ntest1'); 46 | 47 | // multiple files, array syntax 48 | var result = shell.cat(['resources/file2', 'resources/file1']); 49 | assert.equal(shell.error(), null); 50 | assert.equal(result, 'test2\ntest1'); 51 | 52 | var result = shell.cat('resources/file*.txt'); 53 | assert.equal(shell.error(), null); 54 | assert.ok(result.search('test1') > -1); // file order might be random 55 | assert.ok(result.search('test2') > -1); 56 | 57 | shell.exit(123); 58 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/test/index.js: -------------------------------------------------------------------------------- 1 | var console = require("../index") 2 | var test = require("tape") 3 | 4 | if (typeof window !== "undefined" && !window.JSON) { 5 | window.JSON = require("jsonify") 6 | } 7 | 8 | test("console has expected methods", function (assert) { 9 | assert.ok(console.log) 10 | assert.ok(console.info) 11 | assert.ok(console.warn) 12 | assert.ok(console.dir) 13 | assert.ok(console.time, "time") 14 | assert.ok(console.timeEnd, "timeEnd") 15 | assert.ok(console.trace, "trace") 16 | assert.ok(console.assert) 17 | 18 | assert.end() 19 | }) 20 | 21 | test("invoke console.log", function (assert) { 22 | console.log("test-log") 23 | 24 | assert.end() 25 | }) 26 | 27 | test("invoke console.info", function (assert) { 28 | console.info("test-info") 29 | 30 | assert.end() 31 | }) 32 | 33 | test("invoke console.warn", function (assert) { 34 | console.warn("test-warn") 35 | 36 | assert.end() 37 | }) 38 | 39 | test("invoke console.time", function (assert) { 40 | console.time("label") 41 | 42 | assert.end() 43 | }) 44 | 45 | test("invoke console.trace", function (assert) { 46 | console.trace("test-trace") 47 | 48 | assert.end() 49 | }) 50 | 51 | test("invoke console.assert", function (assert) { 52 | console.assert(true) 53 | 54 | assert.end() 55 | }) 56 | 57 | test("invoke console.dir", function (assert) { 58 | console.dir("test-dir") 59 | 60 | assert.end() 61 | }) 62 | 63 | test("invoke console.timeEnd", function (assert) { 64 | console.timeEnd("label") 65 | 66 | assert.end() 67 | }) 68 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/cd.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | // save current dir 17 | var cur = shell.pwd(); 18 | 19 | shell.rm('-rf', 'tmp'); 20 | shell.mkdir('tmp'); 21 | 22 | // 23 | // Invalids 24 | // 25 | 26 | shell.cd(); 27 | assert.ok(shell.error()); 28 | 29 | assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check 30 | shell.cd('/adsfasdf'); // dir does not exist 31 | assert.ok(shell.error()); 32 | 33 | assert.equal(fs.existsSync('resources/file1'), true); // sanity check 34 | shell.cd('resources/file1'); // file, not dir 35 | assert.ok(shell.error()); 36 | 37 | // 38 | // Valids 39 | // 40 | 41 | shell.cd(cur); 42 | shell.cd('tmp'); 43 | assert.equal(shell.error(), null); 44 | assert.equal(path.basename(process.cwd()), 'tmp'); 45 | 46 | shell.cd(cur); 47 | shell.cd('/'); 48 | assert.equal(shell.error(), null); 49 | assert.equal(process.cwd(), path.resolve('/')); 50 | 51 | // cd + other commands 52 | 53 | shell.cd(cur); 54 | shell.rm('-f', 'tmp/*'); 55 | assert.equal(fs.existsSync('tmp/file1'), false); 56 | shell.cd('resources'); 57 | assert.equal(shell.error(), null); 58 | shell.cp('file1', '../tmp'); 59 | assert.equal(shell.error(), null); 60 | shell.cd('../tmp'); 61 | assert.equal(shell.error(), null); 62 | assert.equal(fs.existsSync('file1'), true); 63 | 64 | shell.exit(123); 65 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/sed.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Invalids 21 | // 22 | 23 | shell.sed(); 24 | assert.ok(shell.error()); 25 | 26 | shell.sed(/asdf/g); // too few args 27 | assert.ok(shell.error()); 28 | 29 | shell.sed(/asdf/g, 'nada'); // too few args 30 | assert.ok(shell.error()); 31 | 32 | assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check 33 | shell.sed(/asdf/g, 'nada', '/asdfasdf'); // no such file 34 | assert.ok(shell.error()); 35 | 36 | // 37 | // Valids 38 | // 39 | 40 | shell.cp('-f', 'resources/file1', 'tmp/file1'); 41 | var result = shell.sed('test1', 'hello', 'tmp/file1'); // search string 42 | assert.equal(shell.error(), null); 43 | assert.equal(result, 'hello'); 44 | 45 | var result = shell.sed(/test1/, 'hello', 'tmp/file1'); // search regex 46 | assert.equal(shell.error(), null); 47 | assert.equal(result, 'hello'); 48 | 49 | var result = shell.sed(/test1/, 1234, 'tmp/file1'); // numeric replacement 50 | assert.equal(shell.error(), null); 51 | assert.equal(result, '1234'); 52 | 53 | var result = shell.sed('-i', /test1/, 'hello', 'tmp/file1'); 54 | assert.equal(shell.error(), null); 55 | assert.equal(result, 'hello'); 56 | assert.equal(shell.cat('tmp/file1'), 'hello'); 57 | 58 | shell.exit(123); 59 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Artur Adib 2 | All rights reserved. 3 | 4 | You may use this project under the terms of the New BSD license as follows: 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of Artur Adib nor the 14 | names of the contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/grep.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Invalids 21 | // 22 | 23 | shell.grep(); 24 | assert.ok(shell.error()); 25 | 26 | shell.grep(/asdf/g); // too few args 27 | assert.ok(shell.error()); 28 | 29 | assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check 30 | shell.grep(/asdf/g, '/asdfasdf'); // no such file 31 | assert.ok(shell.error()); 32 | 33 | // 34 | // Valids 35 | // 36 | 37 | var result = shell.grep('line', 'resources/a.txt'); 38 | assert.equal(shell.error(), null); 39 | assert.equal(result.split('\n').length - 1, 4); 40 | 41 | var result = shell.grep('-v', 'line', 'resources/a.txt'); 42 | assert.equal(shell.error(), null); 43 | assert.equal(result.split('\n').length - 1, 8); 44 | 45 | var result = shell.grep('line one', 'resources/a.txt'); 46 | assert.equal(shell.error(), null); 47 | assert.equal(result, 'This is line one\n'); 48 | 49 | // multiple files 50 | var result = shell.grep(/test/, 'resources/file1.txt', 'resources/file2.txt'); 51 | assert.equal(shell.error(), null); 52 | assert.equal(result, 'test1\ntest2\n'); 53 | 54 | // multiple files, array syntax 55 | var result = shell.grep(/test/, ['resources/file1.txt', 'resources/file2.txt']); 56 | assert.equal(shell.error(), null); 57 | assert.equal(result, 'test1\ntest2\n'); 58 | 59 | shell.exit(123); 60 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/test/static/test-adapter.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var Testem = window.Testem 3 | var regex = /^((?:not )?ok) (\d+) (.+)$/ 4 | 5 | Testem.useCustomAdapter(tapAdapter) 6 | 7 | function tapAdapter(socket){ 8 | var results = { 9 | failed: 0 10 | , passed: 0 11 | , total: 0 12 | , tests: [] 13 | } 14 | 15 | socket.emit('tests-start') 16 | 17 | Testem.handleConsoleMessage = function(msg){ 18 | var m = msg.match(regex) 19 | if (m) { 20 | var passed = m[1] === 'ok' 21 | var test = { 22 | passed: passed ? 1 : 0, 23 | failed: passed ? 0 : 1, 24 | total: 1, 25 | id: m[2], 26 | name: m[3], 27 | items: [] 28 | } 29 | 30 | if (passed) { 31 | results.passed++ 32 | } else { 33 | console.error("failure", m) 34 | 35 | results.failed++ 36 | } 37 | 38 | results.total++ 39 | 40 | // console.log("emitted test", test) 41 | socket.emit('test-result', test) 42 | results.tests.push(test) 43 | } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ 44 | // console.log("emitted all test") 45 | socket.emit('all-test-results', results) 46 | } 47 | 48 | // return false if you want to prevent the console message from 49 | // going to the console 50 | // return false 51 | } 52 | } 53 | }()) 54 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/find.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | shell.rm('-rf', 'tmp'); 13 | shell.mkdir('tmp'); 14 | 15 | // 16 | // Invalids 17 | // 18 | 19 | var result = shell.find(); // no paths given 20 | assert.ok(shell.error()); 21 | 22 | // 23 | // Valids 24 | // 25 | 26 | // current path 27 | shell.cd('resources/find'); 28 | var result = shell.find('.'); 29 | assert.equal(shell.error(), null); 30 | assert.equal(result.indexOf('.hidden') > -1, true); 31 | assert.equal(result.indexOf('dir1/dir11/a_dir11') > -1, true); 32 | assert.equal(result.length, 11); 33 | shell.cd('../..'); 34 | 35 | // simple path 36 | var result = shell.find('resources/find'); 37 | assert.equal(shell.error(), null); 38 | assert.equal(result.indexOf('resources/find/.hidden') > -1, true); 39 | assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); 40 | assert.equal(result.length, 11); 41 | 42 | // multiple paths - comma 43 | var result = shell.find('resources/find/dir1', 'resources/find/dir2'); 44 | assert.equal(shell.error(), null); 45 | assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); 46 | assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); 47 | assert.equal(result.length, 6); 48 | 49 | // multiple paths - array 50 | var result = shell.find(['resources/find/dir1', 'resources/find/dir2']); 51 | assert.equal(shell.error(), null); 52 | assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); 53 | assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); 54 | assert.equal(result.length, 6); 55 | 56 | shell.exit(123); 57 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | Browser-friendly inheritance fully compatible with standard node.js 2 | [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). 3 | 4 | This package exports standard `inherits` from node.js `util` module in 5 | node environment, but also provides alternative browser-friendly 6 | implementation through [browser 7 | field](https://gist.github.com/shtylman/4339901). Alternative 8 | implementation is a literal copy of standard one located in standalone 9 | module to avoid requiring of `util`. It also has a shim for old 10 | browsers with no `Object.create` support. 11 | 12 | While keeping you sure you are using standard `inherits` 13 | implementation in node.js environment, it allows bundlers such as 14 | [browserify](https://github.com/substack/node-browserify) to not 15 | include full `util` package to your client code if all you need is 16 | just `inherits` function. It worth, because browser shim for `util` 17 | package is large and `inherits` is often the single function you need 18 | from it. 19 | 20 | It's recommended to use this package instead of 21 | `require('util').inherits` for any code that has chances to be used 22 | not only in node.js but in browser too. 23 | 24 | ## usage 25 | 26 | ```js 27 | var inherits = require('inherits'); 28 | // then use exactly as the standard one 29 | ``` 30 | 31 | ## note on version ~1.0 32 | 33 | Version ~1.0 had completely different motivation and is not compatible 34 | neither with 2.0 nor with standard node.js `inherits`. 35 | 36 | If you are using version ~1.0 and planning to switch to ~2.0, be 37 | careful: 38 | 39 | * new version uses `super_` instead of `super` for referencing 40 | superclass 41 | * new version overwrites current prototype while old one preserves any 42 | existing fields on it 43 | -------------------------------------------------------------------------------- /Support/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jshint", 3 | "version": "2.3.0", 4 | "homepage": "http://jshint.com/", 5 | "description": "Static analysis tool for JavaScript", 6 | 7 | "author": { 8 | "name": "Anton Kovalyov", 9 | "email": "anton@kovalyov.net", 10 | "url": "http://anton.kovalyov.net/" 11 | }, 12 | 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/jshint/jshint.git" 16 | }, 17 | 18 | "bugs": { 19 | "url": "https://github.com/jshint/jshint/issues" 20 | }, 21 | 22 | "bin": { 23 | "jshint": "./bin/jshint" 24 | }, 25 | 26 | "scripts": { 27 | "data": "node scripts/generate-identifier-data", 28 | "build": "node bin/build", 29 | "test": "nodeunit tests tests/regression tests/unit", 30 | "pretest": "jshint src" 31 | }, 32 | 33 | "main": "./src/jshint.js", 34 | 35 | "dependencies": { 36 | "shelljs": "0.1.x", 37 | "underscore": "1.4.x", 38 | "cli": "0.4.x", 39 | "minimatch": "0.x.x", 40 | "htmlparser2": "3.3.x", 41 | "console-browserify": "0.1.x" 42 | }, 43 | 44 | "devDependencies": { 45 | "jshint": "2.3.x", 46 | "shelljs": "0.1.x", 47 | "browserify": "2.12.x", 48 | "coveraje": "0.2.x", 49 | "nodeunit": "0.8.x", 50 | "sinon": "1.7.x", 51 | "unicode-6.3.0": "0.1.x", 52 | "regenerate": "0.5.x" 53 | }, 54 | 55 | "jshintConfig": { 56 | "boss": true, 57 | "node": true, 58 | "strict": true, 59 | "white": true, 60 | "smarttabs": true, 61 | "undef": true, 62 | "unused": true, 63 | "onecase": true, 64 | "lastsemic": true, 65 | "newcap": false, 66 | "maxlen": 100, 67 | "indent": 2 68 | }, 69 | 70 | "licenses": [ 71 | { 72 | "type": "MIT", 73 | "url": "https://github.com/jshint/jshint/blob/master/LICENSE" 74 | } 75 | ], 76 | 77 | "preferGlobal": true, 78 | 79 | "files": [ 80 | "bin", 81 | "src", 82 | "data" 83 | ] 84 | } 85 | -------------------------------------------------------------------------------- /Support/node_modules/cli/examples/echo.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* All of the following commands are equivalent and write `foo\tbar foo` to out.txt 4 | $ ./echo.js -n -e --output=out.txt "foo\tbar" "foo" 5 | $ ./echo.js --newline --escape --output "out.txt" "foo\tbar" "foo" 6 | $ ./echo.js -ne --output=out.txt "foo\tbar" "foo" 7 | $ ./echo.js -en --output="out.txt" "foo\tbar" "foo" 8 | */ 9 | 10 | var cli = require('cli'); 11 | 12 | cli.parse({ 13 | newline: ['n', 'Do not output the trailing newline'], 14 | escape: ['e', 'Enable interpretation of backslash escapes'], 15 | separator: ['s', 'Separate arguments using this value', 'string', ' '], 16 | output: [false, 'Write to FILE rather than the console', 'file'] 17 | }); 18 | 19 | cli.main(function (args, options) { 20 | var output = '', i, j, l, output_stream; 21 | 22 | if (this.argc) { 23 | if (options.escape) { 24 | var replace = {'\\n':'\n','\\r':'\r','\\t':'\t','\\e':'\e','\\v':'\v','\\f':'\f','\\c':'\c','\\b':'\b','\\a':'\a','\\\\':'\\'}; 25 | var escape = function (str) { 26 | string += ''; 27 | for (j in replace) { 28 | string = string.replace(i, replace[i]); 29 | } 30 | return string; 31 | } 32 | for (i = 0, l = this.argc; i < l; i++) { 33 | args[i] = escape(args[i]); 34 | } 35 | options.separator = escape(options.separator); 36 | } 37 | output += args.join(options.separator); 38 | } 39 | 40 | if (!options.newline) { 41 | output += '\n'; 42 | } 43 | 44 | try { 45 | if (options.output) { 46 | output_stream = this.native.fs.createWriteStream(options.output) 47 | } else { 48 | output_stream = process.stdout; 49 | } 50 | output_stream.write(output); 51 | } catch (e) { 52 | this.fatal('Could not write to output stream'); 53 | } 54 | }); -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/bash-comparison.js: -------------------------------------------------------------------------------- 1 | // basic test 2 | // show that it does the same thing by default as the shell. 3 | var tap = require("tap") 4 | , child_process = require("child_process") 5 | , bashResults = require("./bash-results.json") 6 | , globs = Object.keys(bashResults) 7 | , glob = require("../") 8 | , path = require("path") 9 | 10 | // run from the root of the project 11 | // this is usually where you're at anyway, but be sure. 12 | process.chdir(path.resolve(__dirname, "..")) 13 | 14 | function alphasort (a, b) { 15 | a = a.toLowerCase() 16 | b = b.toLowerCase() 17 | return a > b ? 1 : a < b ? -1 : 0 18 | } 19 | 20 | globs.forEach(function (pattern) { 21 | var expect = bashResults[pattern] 22 | // anything regarding the symlink thing will fail on windows, so just skip it 23 | if (process.platform === "win32" && 24 | expect.some(function (m) { 25 | return /\/symlink\//.test(m) 26 | })) 27 | return 28 | 29 | tap.test(pattern, function (t) { 30 | glob(pattern, function (er, matches) { 31 | if (er) 32 | throw er 33 | 34 | // sort and unmark, just to match the shell results 35 | matches = cleanResults(matches) 36 | 37 | t.deepEqual(matches, expect, pattern) 38 | t.end() 39 | }) 40 | }) 41 | 42 | tap.test(pattern + " sync", function (t) { 43 | var matches = cleanResults(glob.sync(pattern)) 44 | 45 | t.deepEqual(matches, expect, "should match shell") 46 | t.end() 47 | }) 48 | }) 49 | 50 | function cleanResults (m) { 51 | // normalize discrepancies in ordering, duplication, 52 | // and ending slashes. 53 | return m.map(function (m) { 54 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 55 | }).sort(alphasort).reduce(function (set, f) { 56 | if (f !== set[set.length - 1]) set.push(f) 57 | return set 58 | }, []).sort(alphasort).map(function (f) { 59 | // de-windows 60 | return (process.platform !== 'win32') ? f 61 | : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/index.js: -------------------------------------------------------------------------------- 1 | /*global window, global*/ 2 | var util = require("util") 3 | var assert = require("assert") 4 | 5 | var slice = Array.prototype.slice 6 | var console 7 | var times = {} 8 | 9 | if (typeof global !== "undefined" && global.console) { 10 | console = global.console 11 | } else if (typeof window !== "undefined" && window.console) { 12 | console = window.console 13 | } else { 14 | console = window.console = {} 15 | } 16 | 17 | var functions = [ 18 | [log, "log"] 19 | , [info, "info"] 20 | , [warn, "warn"] 21 | , [error, "error"] 22 | , [time, "time"] 23 | , [timeEnd, "timeEnd"] 24 | , [trace, "trace"] 25 | , [dir, "dir"] 26 | , [assert, "assert"] 27 | ] 28 | 29 | for (var i = 0; i < functions.length; i++) { 30 | var tuple = functions[i] 31 | var f = tuple[0] 32 | var name = tuple[1] 33 | 34 | if (!console[name]) { 35 | console[name] = f 36 | } 37 | } 38 | 39 | module.exports = console 40 | 41 | function log() {} 42 | 43 | function info() { 44 | console.log.apply(console, arguments) 45 | } 46 | 47 | function warn() { 48 | console.log.apply(console, arguments) 49 | } 50 | 51 | function error() { 52 | console.warn.apply(console, arguments) 53 | } 54 | 55 | function time(label) { 56 | times[label] = Date.now() 57 | } 58 | 59 | function timeEnd(label) { 60 | var time = times[label] 61 | if (!time) { 62 | throw new Error("No such label: " + label) 63 | } 64 | 65 | var duration = Date.now() - time 66 | console.log(label + ": " + duration + "ms") 67 | } 68 | 69 | function trace() { 70 | var err = new Error() 71 | err.name = "Trace" 72 | err.message = util.format.apply(null, arguments) 73 | console.error(err.stack) 74 | } 75 | 76 | function dir(object) { 77 | console.log(util.inspect(object) + "\n") 78 | } 79 | 80 | function assert(expression) { 81 | if (!expression) { 82 | var arr = slice.call(arguments, 1) 83 | assert.ok(false, util.format.apply(null, arr)) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/mark.js: -------------------------------------------------------------------------------- 1 | var test = require("tap").test 2 | var glob = require('../') 3 | process.chdir(__dirname) 4 | 5 | test("mark, no / on pattern", function (t) { 6 | glob("a/*", {mark: true}, function (er, results) { 7 | if (er) 8 | throw er 9 | var expect = [ 'a/abcdef/', 10 | 'a/abcfed/', 11 | 'a/b/', 12 | 'a/bc/', 13 | 'a/c/', 14 | 'a/cb/' ] 15 | 16 | if (process.platform !== "win32") 17 | expect.push('a/symlink/') 18 | 19 | t.same(results, expect) 20 | t.end() 21 | }) 22 | }) 23 | 24 | test("mark=false, no / on pattern", function (t) { 25 | glob("a/*", function (er, results) { 26 | if (er) 27 | throw er 28 | var expect = [ 'a/abcdef', 29 | 'a/abcfed', 30 | 'a/b', 31 | 'a/bc', 32 | 'a/c', 33 | 'a/cb' ] 34 | 35 | if (process.platform !== "win32") 36 | expect.push('a/symlink') 37 | t.same(results, expect) 38 | t.end() 39 | }) 40 | }) 41 | 42 | test("mark=true, / on pattern", function (t) { 43 | glob("a/*/", {mark: true}, function (er, results) { 44 | if (er) 45 | throw er 46 | var expect = [ 'a/abcdef/', 47 | 'a/abcfed/', 48 | 'a/b/', 49 | 'a/bc/', 50 | 'a/c/', 51 | 'a/cb/' ] 52 | if (process.platform !== "win32") 53 | expect.push('a/symlink/') 54 | t.same(results, expect) 55 | t.end() 56 | }) 57 | }) 58 | 59 | test("mark=false, / on pattern", function (t) { 60 | glob("a/*/", function (er, results) { 61 | if (er) 62 | throw er 63 | var expect = [ 'a/abcdef/', 64 | 'a/abcfed/', 65 | 'a/b/', 66 | 'a/bc/', 67 | 'a/c/', 68 | 'a/cb/' ] 69 | if (process.platform !== "win32") 70 | expect.push('a/symlink/') 71 | t.same(results, expect) 72 | t.end() 73 | }) 74 | }) 75 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/sigmund/README.md: -------------------------------------------------------------------------------- 1 | # sigmund 2 | 3 | Quick and dirty signatures for Objects. 4 | 5 | This is like a much faster `deepEquals` comparison, which returns a 6 | string key suitable for caches and the like. 7 | 8 | ## Usage 9 | 10 | ```javascript 11 | function doSomething (someObj) { 12 | var key = sigmund(someObj, maxDepth) // max depth defaults to 10 13 | var cached = cache.get(key) 14 | if (cached) return cached) 15 | 16 | var result = expensiveCalculation(someObj) 17 | cache.set(key, result) 18 | return result 19 | } 20 | ``` 21 | 22 | The resulting key will be as unique and reproducible as calling 23 | `JSON.stringify` or `util.inspect` on the object, but is much faster. 24 | In order to achieve this speed, some differences are glossed over. 25 | For example, the object `{0:'foo'}` will be treated identically to the 26 | array `['foo']`. 27 | 28 | Also, just as there is no way to summon the soul from the scribblings 29 | of a cocain-addled psychoanalyst, there is no way to revive the object 30 | from the signature string that sigmund gives you. In fact, it's 31 | barely even readable. 32 | 33 | As with `sys.inspect` and `JSON.stringify`, larger objects will 34 | produce larger signature strings. 35 | 36 | Because sigmund is a bit less strict than the more thorough 37 | alternatives, the strings will be shorter, and also there is a 38 | slightly higher chance for collisions. For example, these objects 39 | have the same signature: 40 | 41 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 42 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 43 | 44 | Like a good Freudian, sigmund is most effective when you already have 45 | some understanding of what you're looking for. It can help you help 46 | yourself, but you must be willing to do some work as well. 47 | 48 | Cycles are handled, and cyclical objects are silently omitted (though 49 | the key is included in the signature output.) 50 | 51 | The second argument is the maximum depth, which defaults to 10, 52 | because that is the maximum object traversal depth covered by most 53 | insurance carriers. 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #JSHint TextMate Bundle 2 | 3 | TextMate bundle for [JSHint](http://jshint.com/), the (Gentler) JavaScript Code Quality Tool. 4 | 5 | ![Screenshot](https://github.com/downloads/fgnass/fgnass.github.com/jslint.png) 6 | 7 | Features: 8 | 9 | * Pretty UI 10 | * Runs automatically upon save (⌘S) 11 | * Can be bypassed by pressing ⇧⌘S 12 | * JSHint can be run by itself by pressing ^⇧L 13 | * Output is only shown when errors are found 14 | * Window is automatically closed when it looses focus 15 | * Window with error list is closed when all errors are fixed and saved or checked again 16 | * Uses custom JSHint options if `.jshintrc` found in current dir, TextMate project, or User Home 17 | * Auto-updates itself to the latest version of JSHint 18 | * Based on Node.js 19 | 20 | ## Installation 21 | 22 | Download the [zip file](http://github.com/fgnass/jshint.tmbundle/zipball/master) and rename the 23 | extracted folder to `jshint.tmbundle`. Double-click. 24 | 25 | ## Prerequisites 26 | 27 | You need [Node.js](http://nodejs.org/) and TextMate, that's all. 28 | 29 | This bundle uses `#!/bin/env node` to launch the node process. If you get a *node - not found* error, the `PATH` variable is probably not setup properly in TextMate (this happens when you start TextMate via the Finder rather than from the command-line). Either add or extend the PATH variable in TextMate preferences to include path to node binary. 30 | 31 | You can set the PATH either via Preferences → Variables or by editing `~/.MacOSX/environment.plist`. 32 | 33 | Example: When installed with [homebrew](http://brew.sh/), path to node is `/usr/local/bin/node`. If jshint.tmbundle can't find executable node add `/usr/local/bin` to existing TextMate PATH: 34 | 35 | PATH $PATH:/usr/local/bin 36 | 37 | ## TODO 38 | 39 | Consider including/updating a local copy of latest stable JSHint installed using node/npm instead of automatically downloading source files directly from JSHint repo. 40 | 41 | ## Contributors 42 | 43 | * [Pierre Bertet](https://github.com/bpierre/) 44 | * [Rob-ot](https://github.com/Rob-ot/) 45 | * [Stephen Bannasch](https://github.com/stepheneb/) 46 | -------------------------------------------------------------------------------- /Support/node_modules/underscore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "underscore", 3 | "description": "JavaScript's functional programming helper library.", 4 | "homepage": "http://underscorejs.org", 5 | "keywords": [ 6 | "util", 7 | "functional", 8 | "server", 9 | "client", 10 | "browser" 11 | ], 12 | "author": { 13 | "name": "Jeremy Ashkenas", 14 | "email": "jeremy@documentcloud.org" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/documentcloud/underscore.git" 19 | }, 20 | "main": "underscore.js", 21 | "version": "1.4.4", 22 | "devDependencies": { 23 | "phantomjs": "0.2.2" 24 | }, 25 | "scripts": { 26 | "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" 27 | }, 28 | "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", 29 | "readmeFilename": "README.md", 30 | "bugs": { 31 | "url": "https://github.com/documentcloud/underscore/issues" 32 | }, 33 | "_id": "underscore@1.4.4", 34 | "_from": "underscore@1.4.x" 35 | } 36 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/pause-resume.js: -------------------------------------------------------------------------------- 1 | // show that no match events happen while paused. 2 | var tap = require("tap") 3 | , child_process = require("child_process") 4 | // just some gnarly pattern with lots of matches 5 | , pattern = "test/a/!(symlink)/**" 6 | , bashResults = require("./bash-results.json") 7 | , patterns = Object.keys(bashResults) 8 | , glob = require("../") 9 | , Glob = glob.Glob 10 | , path = require("path") 11 | 12 | // run from the root of the project 13 | // this is usually where you're at anyway, but be sure. 14 | process.chdir(path.resolve(__dirname, "..")) 15 | 16 | function alphasort (a, b) { 17 | a = a.toLowerCase() 18 | b = b.toLowerCase() 19 | return a > b ? 1 : a < b ? -1 : 0 20 | } 21 | 22 | function cleanResults (m) { 23 | // normalize discrepancies in ordering, duplication, 24 | // and ending slashes. 25 | return m.map(function (m) { 26 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 27 | }).sort(alphasort).reduce(function (set, f) { 28 | if (f !== set[set.length - 1]) set.push(f) 29 | return set 30 | }, []).sort(alphasort).map(function (f) { 31 | // de-windows 32 | return (process.platform !== 'win32') ? f 33 | : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') 34 | }) 35 | } 36 | 37 | var globResults = [] 38 | tap.test("use a Glob object, and pause/resume it", function (t) { 39 | var g = new Glob(pattern) 40 | , paused = false 41 | , res = [] 42 | , expect = bashResults[pattern] 43 | 44 | g.on("pause", function () { 45 | console.error("pause") 46 | }) 47 | 48 | g.on("resume", function () { 49 | console.error("resume") 50 | }) 51 | 52 | g.on("match", function (m) { 53 | t.notOk(g.paused, "must not be paused") 54 | globResults.push(m) 55 | g.pause() 56 | t.ok(g.paused, "must be paused") 57 | setTimeout(g.resume.bind(g), 10) 58 | }) 59 | 60 | g.on("end", function (matches) { 61 | t.pass("reached glob end") 62 | globResults = cleanResults(globResults) 63 | matches = cleanResults(matches) 64 | t.deepEqual(matches, globResults, 65 | "end event matches should be the same as match events") 66 | 67 | t.deepEqual(matches, expect, 68 | "glob matches should be the same as bash results") 69 | 70 | t.end() 71 | }) 72 | }) 73 | 74 | -------------------------------------------------------------------------------- /Support/node_modules/console-browserify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "console-browserify", 3 | "version": "0.1.6", 4 | "description": "Emulate console for all the browsers", 5 | "keywords": [], 6 | "author": { 7 | "name": "Raynos", 8 | "email": "raynos2@gmail.com" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/Raynos/console-browserify.git" 13 | }, 14 | "main": "index", 15 | "homepage": "https://github.com/Raynos/console-browserify", 16 | "contributors": [ 17 | { 18 | "name": "Raynos" 19 | } 20 | ], 21 | "bugs": { 22 | "url": "https://github.com/Raynos/console-browserify/issues", 23 | "email": "raynos2@gmail.com" 24 | }, 25 | "dependencies": {}, 26 | "devDependencies": { 27 | "tape": "~0.2.2", 28 | "browserify": "https://github.com/raynos/node-browserify/tarball/master", 29 | "testem": "~0.2.55", 30 | "jsonify": "0.0.0" 31 | }, 32 | "licenses": [ 33 | { 34 | "type": "MIT", 35 | "url": "http://github.com/Raynos/console-browserify/raw/master/LICENSE" 36 | } 37 | ], 38 | "scripts": { 39 | "test": "node ./test", 40 | "build": "browserify test/index.js -o test/static/bundle.js", 41 | "testem": "testem" 42 | }, 43 | "testling": { 44 | "files": "test/index.js", 45 | "browsers": { 46 | "ie": [ 47 | "6", 48 | "7", 49 | "8", 50 | "9", 51 | "10" 52 | ], 53 | "firefox": [ 54 | "16", 55 | "17", 56 | "nightly" 57 | ], 58 | "chrome": [ 59 | "22", 60 | "23", 61 | "canary" 62 | ], 63 | "opera": [ 64 | "12", 65 | "next" 66 | ], 67 | "safari": [ 68 | "5.1" 69 | ] 70 | } 71 | }, 72 | "readme": "# console-browserify\n\n[![build status][1]][2]\n\n[![browser support][3]][4]\n\nEmulate console for all the browsers\n\n## Example\n\n```js\nvar console = require(\"console-browserify\")\n\nconsole.log(\"hello world!\")\n```\n\n## Installation\n\n`npm install console-browserify`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n\n\n [1]: https://secure.travis-ci.org/Raynos/console-browserify.png\n [2]: http://travis-ci.org/Raynos/console-browserify\n [3]: http://ci.testling.com/Raynos/console-browserify.png\n [4]: http://ci.testling.com/Raynos/console-browserify\n", 73 | "readmeFilename": "README.md", 74 | "_id": "console-browserify@0.1.6", 75 | "_from": "console-browserify@0.1.x" 76 | } 77 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 4 | "version": "2.0.1", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented", 11 | "inherits", 12 | "browser", 13 | "browserify" 14 | ], 15 | "main": "./inherits.js", 16 | "browser": "./inherits_browser.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/inherits" 20 | }, 21 | "license": "ISC", 22 | "scripts": { 23 | "test": "node test" 24 | }, 25 | "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", 26 | "readmeFilename": "README.md", 27 | "bugs": { 28 | "url": "https://github.com/isaacs/inherits/issues" 29 | }, 30 | "_id": "inherits@2.0.1", 31 | "_from": "inherits@2" 32 | } 33 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/test.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | shell.rm('-rf', 'tmp'); 13 | shell.mkdir('tmp'); 14 | 15 | // 16 | // Invalids 17 | // 18 | 19 | var result = shell.test(); // no expression given 20 | assert.ok(shell.error()); 21 | 22 | var result = shell.test('asdf'); // bad expression 23 | assert.ok(shell.error()); 24 | 25 | var result = shell.test('f', 'resources/file1'); // bad expression 26 | assert.ok(shell.error()); 27 | 28 | var result = shell.test('-f'); // no file 29 | assert.ok(shell.error()); 30 | 31 | // 32 | // Valids 33 | // 34 | 35 | //exists 36 | var result = shell.test('-e', 'resources/file1'); 37 | assert.equal(shell.error(), null); 38 | assert.equal(result, true);//true 39 | 40 | var result = shell.test('-e', 'resources/404'); 41 | assert.equal(shell.error(), null); 42 | assert.equal(result, false); 43 | 44 | //directory 45 | var result = shell.test('-d', 'resources'); 46 | assert.equal(shell.error(), null); 47 | assert.equal(result, true);//true 48 | 49 | var result = shell.test('-f', 'resources'); 50 | assert.equal(shell.error(), null); 51 | assert.equal(result, false); 52 | 53 | var result = shell.test('-L', 'resources'); 54 | assert.equal(shell.error(), null); 55 | assert.equal(result, false); 56 | 57 | //file 58 | var result = shell.test('-d', 'resources/file1'); 59 | assert.equal(shell.error(), null); 60 | assert.equal(result, false); 61 | 62 | var result = shell.test('-f', 'resources/file1'); 63 | assert.equal(shell.error(), null); 64 | assert.equal(result, true);//true 65 | 66 | var result = shell.test('-L', 'resources/file1'); 67 | assert.equal(shell.error(), null); 68 | assert.equal(result, false); 69 | 70 | //link 71 | var result = shell.test('-d', 'resources/link'); 72 | assert.equal(shell.error(), null); 73 | assert.equal(result, false); 74 | 75 | var result = shell.test('-f', 'resources/link'); 76 | assert.equal(shell.error(), null); 77 | assert.equal(result, true);//true 78 | 79 | var result = shell.test('-L', 'resources/link'); 80 | assert.equal(shell.error(), null); 81 | assert.equal(result, true);//true 82 | 83 | var result = shell.test('-L', 'resources/badlink'); 84 | assert.equal(shell.error(), null); 85 | assert.equal(result, true);//true 86 | 87 | var result = shell.test('-L', 'resources/404'); 88 | assert.equal(shell.error(), null); 89 | assert.equal(result, false);//false 90 | 91 | shell.exit(123); 92 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/mkdir.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Invalids 21 | // 22 | 23 | shell.mkdir(); 24 | assert.ok(shell.error()); 25 | 26 | var mtime = fs.statSync('tmp').mtime.toString(); 27 | shell.mkdir('tmp'); // dir already exists 28 | assert.ok(shell.error()); 29 | assert.equal(fs.statSync('tmp').mtime.toString(), mtime); // didn't mess with dir 30 | 31 | assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check 32 | shell.mkdir('/asdfasdf/asdfasdf'); // root path does not exist 33 | assert.ok(shell.error()); 34 | assert.equal(fs.existsSync('/asdfasdf'), false); 35 | 36 | // 37 | // Valids 38 | // 39 | 40 | assert.equal(fs.existsSync('tmp/t1'), false); 41 | shell.mkdir('tmp/t1'); // simple dir 42 | assert.equal(shell.error(), null); 43 | assert.equal(fs.existsSync('tmp/t1'), true); 44 | 45 | assert.equal(fs.existsSync('tmp/t2'), false); 46 | assert.equal(fs.existsSync('tmp/t3'), false); 47 | shell.mkdir('tmp/t2', 'tmp/t3'); // multiple dirs 48 | assert.equal(shell.error(), null); 49 | assert.equal(fs.existsSync('tmp/t2'), true); 50 | assert.equal(fs.existsSync('tmp/t3'), true); 51 | 52 | assert.equal(fs.existsSync('tmp/t1'), true); 53 | assert.equal(fs.existsSync('tmp/t4'), false); 54 | shell.mkdir('tmp/t1', 'tmp/t4'); // one dir exists, one doesn't 55 | assert.equal(numLines(shell.error()), 1); 56 | assert.equal(fs.existsSync('tmp/t1'), true); 57 | assert.equal(fs.existsSync('tmp/t4'), true); 58 | 59 | assert.equal(fs.existsSync('tmp/a'), false); 60 | shell.mkdir('-p', 'tmp/a/b/c'); 61 | assert.equal(shell.error(), null); 62 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 63 | shell.rm('-Rf', 'tmp/a'); // revert 64 | 65 | // multiple dirs 66 | shell.mkdir('-p', 'tmp/zzza', 'tmp/zzzb', 'tmp/zzzc'); 67 | assert.equal(shell.error(), null); 68 | assert.equal(fs.existsSync('tmp/zzza'), true); 69 | assert.equal(fs.existsSync('tmp/zzzb'), true); 70 | assert.equal(fs.existsSync('tmp/zzzc'), true); 71 | 72 | // multiple dirs, array syntax 73 | shell.mkdir('-p', ['tmp/yyya', 'tmp/yyyb', 'tmp/yyyc']); 74 | assert.equal(shell.error(), null); 75 | assert.equal(fs.existsSync('tmp/yyya'), true); 76 | assert.equal(fs.existsSync('tmp/yyyb'), true); 77 | assert.equal(fs.existsSync('tmp/yyyc'), true); 78 | 79 | shell.exit(123); 80 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/sigmund/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sigmund", 3 | "version": "1.0.0", 4 | "description": "Quick and dirty signatures for Objects.", 5 | "main": "sigmund.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "tap": "~0.3.0" 12 | }, 13 | "scripts": { 14 | "test": "tap test/*.js", 15 | "bench": "node bench.js" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/sigmund" 20 | }, 21 | "keywords": [ 22 | "object", 23 | "signature", 24 | "key", 25 | "data", 26 | "psychoanalysis" 27 | ], 28 | "author": { 29 | "name": "Isaac Z. Schlueter", 30 | "email": "i@izs.me", 31 | "url": "http://blog.izs.me/" 32 | }, 33 | "license": "BSD", 34 | "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", 35 | "readmeFilename": "README.md", 36 | "bugs": { 37 | "url": "https://github.com/isaacs/sigmund/issues" 38 | }, 39 | "_id": "sigmund@1.0.0", 40 | "_from": "sigmund@~1.0.0" 41 | } 42 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/nocase-nomagic.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var test = require('tap').test; 3 | var glob = require('../'); 4 | 5 | test('mock fs', function(t) { 6 | var stat = fs.stat 7 | var statSync = fs.statSync 8 | var readdir = fs.readdir 9 | var readdirSync = fs.readdirSync 10 | 11 | function fakeStat(path) { 12 | var ret 13 | switch (path.toLowerCase()) { 14 | case '/tmp': case '/tmp/': 15 | ret = { isDirectory: function() { return true } } 16 | break 17 | case '/tmp/a': 18 | ret = { isDirectory: function() { return false } } 19 | break 20 | } 21 | return ret 22 | } 23 | 24 | fs.stat = function(path, cb) { 25 | var f = fakeStat(path); 26 | if (f) { 27 | process.nextTick(function() { 28 | cb(null, f) 29 | }) 30 | } else { 31 | stat.call(fs, path, cb) 32 | } 33 | } 34 | 35 | fs.statSync = function(path) { 36 | return fakeStat(path) || statSync.call(fs, path) 37 | } 38 | 39 | function fakeReaddir(path) { 40 | var ret 41 | switch (path.toLowerCase()) { 42 | case '/tmp': case '/tmp/': 43 | ret = [ 'a', 'A' ] 44 | break 45 | case '/': 46 | ret = ['tmp', 'tMp', 'tMP', 'TMP'] 47 | } 48 | return ret 49 | } 50 | 51 | fs.readdir = function(path, cb) { 52 | var f = fakeReaddir(path) 53 | if (f) 54 | process.nextTick(function() { 55 | cb(null, f) 56 | }) 57 | else 58 | readdir.call(fs, path, cb) 59 | } 60 | 61 | fs.readdirSync = function(path) { 62 | return fakeReaddir(path) || readdirSync.call(fs, path) 63 | } 64 | 65 | t.pass('mocked') 66 | t.end() 67 | }) 68 | 69 | test('nocase, nomagic', function(t) { 70 | var n = 2 71 | var want = [ '/TMP/A', 72 | '/TMP/a', 73 | '/tMP/A', 74 | '/tMP/a', 75 | '/tMp/A', 76 | '/tMp/a', 77 | '/tmp/A', 78 | '/tmp/a' ] 79 | glob('/tmp/a', { nocase: true }, function(er, res) { 80 | if (er) 81 | throw er 82 | t.same(res.sort(), want) 83 | if (--n === 0) t.end() 84 | }) 85 | glob('/tmp/A', { nocase: true }, function(er, res) { 86 | if (er) 87 | throw er 88 | t.same(res.sort(), want) 89 | if (--n === 0) t.end() 90 | }) 91 | }) 92 | 93 | test('nocase, with some magic', function(t) { 94 | t.plan(2) 95 | var want = [ '/TMP/A', 96 | '/TMP/a', 97 | '/tMP/A', 98 | '/tMP/a', 99 | '/tMp/A', 100 | '/tMp/a', 101 | '/tmp/A', 102 | '/tmp/a' ] 103 | glob('/tmp/*', { nocase: true }, function(er, res) { 104 | if (er) 105 | throw er 106 | t.same(res.sort(), want) 107 | }) 108 | glob('/tmp/*', { nocase: true }, function(er, res) { 109 | if (er) 110 | throw er 111 | t.same(res.sort(), want) 112 | }) 113 | }) 114 | -------------------------------------------------------------------------------- /Support/output.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jshint 5 | 61 | 62 | 63 |
{body}
64 | 65 | 124 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/exec.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'), 6 | util = require('util'), 7 | child = require('child_process'); 8 | 9 | shell.config.silent = true; 10 | 11 | function numLines(str) { 12 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 13 | } 14 | 15 | // 16 | // Invalids 17 | // 18 | 19 | shell.exec(); 20 | assert.ok(shell.error()); 21 | 22 | var result = shell.exec('asdfasdf'); // could not find command 23 | assert.ok(result.code > 0); 24 | 25 | 26 | // 27 | // Valids 28 | // 29 | 30 | // 31 | // sync 32 | // 33 | 34 | // check if stdout goes to output 35 | var result = shell.exec('node -e \"console.log(1234);\"'); 36 | assert.equal(shell.error(), null); 37 | assert.equal(result.code, 0); 38 | assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 39 | 40 | // check if stderr goes to output 41 | var result = shell.exec('node -e \"console.error(1234);\"'); 42 | assert.equal(shell.error(), null); 43 | assert.equal(result.code, 0); 44 | assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 45 | 46 | // check if stdout + stderr go to output 47 | var result = shell.exec('node -e \"console.error(1234); console.log(666);\"'); 48 | assert.equal(shell.error(), null); 49 | assert.equal(result.code, 0); 50 | assert.ok(result.output === '1234\n666\n' || result.output === '1234\n666\nundefined\n'); // 'undefined' for v0.4 51 | 52 | // check exit code 53 | var result = shell.exec('node -e \"process.exit(12);\"'); 54 | assert.equal(shell.error(), null); 55 | assert.equal(result.code, 12); 56 | 57 | // interaction with cd 58 | shell.cd('resources/external'); 59 | var result = shell.exec('node node_script.js'); 60 | assert.equal(shell.error(), null); 61 | assert.equal(result.code, 0); 62 | assert.equal(result.output, 'node_script_1234\n'); 63 | shell.cd('../..'); 64 | 65 | // check quotes escaping 66 | var result = shell.exec( util.format('node -e "console.log(%s);"', "\\\"\\'+\\'_\\'+\\'\\\"") ); 67 | assert.equal(shell.error(), null); 68 | assert.equal(result.code, 0); 69 | assert.equal(result.output, "'+'_'+'\n"); 70 | 71 | // 72 | // async 73 | // 74 | 75 | // no callback 76 | var c = shell.exec('node -e \"console.log(1234)\"', {async:true}); 77 | assert.equal(shell.error(), null); 78 | assert.ok('stdout' in c, 'async exec returns child process object'); 79 | 80 | // 81 | // callback as 2nd argument 82 | // 83 | shell.exec('node -e \"console.log(5678);\"', function(code, output) { 84 | assert.equal(code, 0); 85 | assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 86 | 87 | // 88 | // callback as 3rd argument 89 | // 90 | shell.exec('node -e \"console.log(5566);\"', {async:true}, function(code, output) { 91 | assert.equal(code, 0); 92 | assert.ok(output === '5566\n' || output === '5566\nundefined\n'); // 'undefined' for v0.4 93 | 94 | // 95 | // callback as 3rd argument (slient:true) 96 | // 97 | shell.exec('node -e \"console.log(5678);\"', {silent:true}, function(code, output) { 98 | assert.equal(code, 0); 99 | assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 100 | 101 | shell.exit(123); 102 | 103 | }); 104 | 105 | }); 106 | 107 | }); 108 | 109 | assert.equal(shell.error(), null); 110 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/popd.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | var root = path.resolve(), trail; 13 | 14 | function reset() { 15 | shell.dirs('-c'); 16 | shell.cd(root); 17 | } 18 | 19 | // Valid 20 | shell.pushd('resources/pushd'); 21 | trail = shell.popd(); 22 | assert.equal(shell.error(), null); 23 | assert.equal(process.cwd(), trail[0]); 24 | assert.deepEqual(trail, [ root ]); 25 | 26 | shell.pushd('resources/pushd'); 27 | shell.pushd('a'); 28 | trail = shell.popd(); 29 | assert.equal(shell.error(), null); 30 | assert.equal(process.cwd(), trail[0]); 31 | assert.deepEqual(trail, [ 32 | path.resolve(root, 'resources/pushd'), 33 | root 34 | ]); 35 | 36 | shell.pushd('b'); 37 | trail = shell.popd(); 38 | assert.equal(shell.error(), null); 39 | assert.equal(process.cwd(), trail[0]); 40 | assert.deepEqual(trail, [ 41 | path.resolve(root, 'resources/pushd'), 42 | root 43 | ]); 44 | 45 | shell.pushd('b'); 46 | shell.pushd('c'); 47 | trail = shell.popd(); 48 | assert.equal(shell.error(), null); 49 | assert.equal(process.cwd(), trail[0]); 50 | assert.deepEqual(trail, [ 51 | path.resolve(root, 'resources/pushd/b'), 52 | path.resolve(root, 'resources/pushd'), 53 | root 54 | ]); 55 | 56 | trail = shell.popd(); 57 | assert.equal(shell.error(), null); 58 | assert.equal(process.cwd(), trail[0]); 59 | assert.deepEqual(trail, [ 60 | path.resolve(root, 'resources/pushd'), 61 | root 62 | ]); 63 | 64 | trail = shell.popd(); 65 | assert.equal(shell.error(), null); 66 | assert.equal(trail.length, 1); 67 | assert.equal(process.cwd(), trail[0]); 68 | assert.deepEqual(trail, [ root ]); 69 | 70 | // Valid by index 71 | shell.pushd('resources/pushd'); 72 | trail = shell.popd('+0'); 73 | assert.equal(shell.error(), null); 74 | assert.equal(process.cwd(), trail[0]); 75 | assert.deepEqual(trail, [ root ]); 76 | 77 | shell.pushd('resources/pushd'); 78 | trail = shell.popd('+1'); 79 | assert.equal(shell.error(), null); 80 | assert.equal(process.cwd(), trail[0]); 81 | assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); 82 | 83 | reset(); shell.pushd('resources/pushd'); 84 | trail = shell.popd('-0'); 85 | assert.equal(shell.error(), null); 86 | assert.equal(process.cwd(), trail[0]); 87 | assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); 88 | 89 | reset(); shell.pushd('resources/pushd'); 90 | trail = shell.popd('-1'); 91 | assert.equal(shell.error(), null); 92 | assert.equal(process.cwd(), trail[0]); 93 | assert.deepEqual(trail, [ root ]); 94 | 95 | 96 | reset(); shell.pushd('resources/pushd'); 97 | trail = shell.popd('-n'); 98 | assert.equal(shell.error(), null); 99 | assert.equal(process.cwd(), trail[0]); 100 | assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); 101 | 102 | // Invalid 103 | trail = shell.popd(); 104 | assert.ok(shell.error('popd: directory stack empty\n')); 105 | 106 | // Test that the root dir is not stored 107 | shell.cd('resources/pushd'); 108 | shell.pushd('b'); 109 | trail = shell.popd(); 110 | assert.equal(shell.error(), null); 111 | assert.equal(trail[0], path.resolve(root, 'resources/pushd')); 112 | assert.equal(process.cwd(), trail[0]); 113 | shell.popd(); 114 | assert.ok(shell.error(), null); 115 | 116 | shell.cd(root); 117 | 118 | shell.exit(123); -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/README.md: -------------------------------------------------------------------------------- 1 | # lru cache 2 | 3 | A cache object that deletes the least-recently-used items. 4 | 5 | ## Usage: 6 | 7 | ```javascript 8 | var LRU = require("lru-cache") 9 | , options = { max: 500 10 | , length: function (n) { return n * 2 } 11 | , dispose: function (key, n) { n.close() } 12 | , maxAge: 1000 * 60 * 60 } 13 | , cache = LRU(options) 14 | , otherCache = LRU(50) // sets just the max size 15 | 16 | cache.set("key", "value") 17 | cache.get("key") // "value" 18 | 19 | cache.reset() // empty the cache 20 | ``` 21 | 22 | If you put more stuff in it, then items will fall out. 23 | 24 | If you try to put an oversized thing in it, then it'll fall out right 25 | away. 26 | 27 | ## Options 28 | 29 | * `max` The maximum size of the cache, checked by applying the length 30 | function to all values in the cache. Not setting this is kind of 31 | silly, since that's the whole purpose of this lib, but it defaults 32 | to `Infinity`. 33 | * `maxAge` Maximum age in ms. Items are not pro-actively pruned out 34 | as they age, but if you try to get an item that is too old, it'll 35 | drop it and return undefined instead of giving it to you. 36 | * `length` Function that is used to calculate the length of stored 37 | items. If you're storing strings or buffers, then you probably want 38 | to do something like `function(n){return n.length}`. The default is 39 | `function(n){return 1}`, which is fine if you want to store `n` 40 | like-sized things. 41 | * `dispose` Function that is called on items when they are dropped 42 | from the cache. This can be handy if you want to close file 43 | descriptors or do other cleanup tasks when items are no longer 44 | accessible. Called with `key, value`. It's called *before* 45 | actually removing the item from the internal cache, so if you want 46 | to immediately put it back in, you'll have to do that in a 47 | `nextTick` or `setTimeout` callback or it won't do anything. 48 | * `stale` By default, if you set a `maxAge`, it'll only actually pull 49 | stale items out of the cache when you `get(key)`. (That is, it's 50 | not pre-emptively doing a `setTimeout` or anything.) If you set 51 | `stale:true`, it'll return the stale value before deleting it. If 52 | you don't set this, then it'll return `undefined` when you try to 53 | get a stale entry, as if it had already been deleted. 54 | 55 | ## API 56 | 57 | * `set(key, value)` 58 | * `get(key) => value` 59 | 60 | Both of these will update the "recently used"-ness of the key. 61 | They do what you think. 62 | 63 | * `peek(key)` 64 | 65 | Returns the key value (or `undefined` if not found) without 66 | updating the "recently used"-ness of the key. 67 | 68 | (If you find yourself using this a lot, you *might* be using the 69 | wrong sort of data structure, but there are some use cases where 70 | it's handy.) 71 | 72 | * `del(key)` 73 | 74 | Deletes a key out of the cache. 75 | 76 | * `reset()` 77 | 78 | Clear the cache entirely, throwing away all values. 79 | 80 | * `has(key)` 81 | 82 | Check if a key is in the cache, without updating the recent-ness 83 | or deleting it for being stale. 84 | 85 | * `forEach(function(value,key,cache), [thisp])` 86 | 87 | Just like `Array.prototype.forEach`. Iterates over all the keys 88 | in the cache, in order of recent-ness. (Ie, more recently used 89 | items are iterated over first.) 90 | 91 | * `keys()` 92 | 93 | Return an array of the keys in the cache. 94 | 95 | * `values()` 96 | 97 | Return an array of the values in the cache. 98 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/chmod.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | shell.config.silent = true; 8 | 9 | // 10 | // Invalids 11 | // 12 | 13 | shell.chmod('blah'); // missing args 14 | assert.ok(shell.error()); 15 | shell.chmod('893', 'resources/chmod'); // invalid permissions - mode must be in octal 16 | assert.ok(shell.error()); 17 | 18 | // 19 | // Valids 20 | // 21 | 22 | // Test files - the bitmasking is to ignore the upper bits. 23 | shell.chmod('755', 'resources/chmod/file1'); 24 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('755', 8)); 25 | shell.chmod('644', 'resources/chmod/file1'); 26 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); 27 | 28 | shell.chmod('o+x', 'resources/chmod/file1'); 29 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('007', 8), parseInt('005', 8)); 30 | shell.chmod('644', 'resources/chmod/file1'); 31 | 32 | shell.chmod('+x', 'resources/chmod/file1'); 33 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('755', 8)); 34 | shell.chmod('644', 'resources/chmod/file1'); 35 | 36 | // Test setuid 37 | shell.chmod('u+s', 'resources/chmod/file1'); 38 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('4000', 8), parseInt('4000', 8)); 39 | shell.chmod('u-s', 'resources/chmod/file1'); 40 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); 41 | 42 | // according to POSIX standards at http://linux.die.net/man/1/chmod, 43 | // setuid is never cleared from a directory unless explicitly asked for. 44 | shell.chmod('u+s', 'resources/chmod/c'); 45 | shell.chmod('755', 'resources/chmod/c'); 46 | assert.equal(fs.statSync('resources/chmod/c').mode & parseInt('4000', 8), parseInt('4000', 8)); 47 | shell.chmod('u-s', 'resources/chmod/c'); 48 | 49 | // Test setgid 50 | shell.chmod('g+s', 'resources/chmod/file1'); 51 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('2000', 8), parseInt('2000', 8)); 52 | shell.chmod('g-s', 'resources/chmod/file1'); 53 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); 54 | 55 | // Test sticky bit 56 | shell.chmod('+t', 'resources/chmod/file1'); 57 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('1000', 8), parseInt('1000', 8)); 58 | shell.chmod('-t', 'resources/chmod/file1'); 59 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); 60 | assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('1000', 8), 0); 61 | 62 | // Test directories 63 | shell.chmod('a-w', 'resources/chmod/b/a/b'); 64 | assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('555', 8)); 65 | shell.chmod('755', 'resources/chmod/b/a/b'); 66 | 67 | // Test recursion 68 | shell.chmod('-R', 'a+w', 'resources/chmod/b'); 69 | assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('777', 8)); 70 | shell.chmod('-R', '755', 'resources/chmod/b'); 71 | assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('755', 8)); 72 | 73 | // Test symbolic links w/ recursion - WARNING: *nix only 74 | fs.symlinkSync('resources/chmod/b/a', 'resources/chmod/a/b/c/link', 'dir'); 75 | shell.chmod('-R', 'u-w', 'resources/chmod/a/b'); 76 | assert.equal(fs.statSync('resources/chmod/a/b/c').mode & parseInt('700', 8), parseInt('500', 8)); 77 | assert.equal(fs.statSync('resources/chmod/b/a').mode & parseInt('700', 8), parseInt('700', 8)); 78 | shell.chmod('-R', 'u+w', 'resources/chmod/a/b'); 79 | fs.unlinkSync('resources/chmod/a/b/c/link'); 80 | 81 | shell.exit(123); -------------------------------------------------------------------------------- /Support/style.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | exports.register = function (linter) { 4 | // Check for properties named __proto__. This special property was 5 | // deprecated and then re-introduced for ES6. 6 | 7 | linter.on("Identifier", function style_scanProto(data) { 8 | if (linter.getOption("proto")) { 9 | return; 10 | } 11 | 12 | if (data.name === "__proto__") { 13 | linter.warn("W103", { 14 | line: data.line, 15 | char: data.char, 16 | data: [ data.name ] 17 | }); 18 | } 19 | }); 20 | 21 | // Check for properties named __iterator__. This is a special property 22 | // available only in browsers with JavaScript 1.7 implementation. 23 | 24 | linter.on("Identifier", function style_scanIterator(data) { 25 | if (linter.getOption("iterator")) { 26 | return; 27 | } 28 | 29 | if (data.name === "__iterator__") { 30 | linter.warn("W104", { 31 | line: data.line, 32 | char: data.char, 33 | data: [ data.name ] 34 | }); 35 | } 36 | }); 37 | 38 | // Check for dangling underscores. 39 | 40 | linter.on("Identifier", function style_scanDangling(data) { 41 | if (!linter.getOption("nomen")) { 42 | return; 43 | } 44 | 45 | // Underscore.js 46 | if (data.name === "_") { 47 | return; 48 | } 49 | 50 | // In Node, __dirname and __filename should be ignored. 51 | if (linter.getOption("node")) { 52 | if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { 53 | return; 54 | } 55 | } 56 | 57 | if (/^(_+.*|.*_+)$/.test(data.name)) { 58 | linter.warn("W105", { 59 | line: data.line, 60 | char: data.from, 61 | data: [ "dangling '_'", data.name ] 62 | }); 63 | } 64 | }); 65 | 66 | // Check that all identifiers are using camelCase notation. 67 | // Exceptions: names like MY_VAR and _myVar. 68 | 69 | linter.on("Identifier", function style_scanCamelCase(data) { 70 | if (!linter.getOption("camelcase")) { 71 | return; 72 | } 73 | 74 | if (data.name.replace(/^_+|_+$/g, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { 75 | linter.warn("W106", { 76 | line: data.line, 77 | char: data.from, 78 | data: [ data.name ] 79 | }); 80 | } 81 | }); 82 | 83 | // Enforce consistency in style of quoting. 84 | 85 | linter.on("String", function style_scanQuotes(data) { 86 | var quotmark = linter.getOption("quotmark"); 87 | var code; 88 | 89 | if (!quotmark) { 90 | return; 91 | } 92 | 93 | // If quotmark is set to 'single' warn about all double-quotes. 94 | 95 | if (quotmark === "single" && data.quote !== "'") { 96 | code = "W109"; 97 | } 98 | 99 | // If quotmark is set to 'double' warn about all single-quotes. 100 | 101 | if (quotmark === "double" && data.quote !== "\"") { 102 | code = "W108"; 103 | } 104 | 105 | // If quotmark is set to true, remember the first quotation style 106 | // and then warn about all others. 107 | 108 | if (quotmark === true) { 109 | if (!linter.getCache("quotmark")) { 110 | linter.setCache("quotmark", data.quote); 111 | } 112 | 113 | if (linter.getCache("quotmark") !== data.quote) { 114 | code = "W110"; 115 | } 116 | } 117 | 118 | if (code) { 119 | linter.warn(code, { 120 | line: data.line, 121 | char: data.char, 122 | }); 123 | } 124 | }); 125 | 126 | linter.on("Number", function style_scanNumbers(data) { 127 | if (data.value.charAt(0) === ".") { 128 | // Warn about a leading decimal point. 129 | linter.warn("W008", { 130 | line: data.line, 131 | char: data.char, 132 | data: [ data.value ] 133 | }); 134 | } 135 | 136 | if (data.value.substr(data.value.length - 1) === ".") { 137 | // Warn about a trailing decimal point. 138 | linter.warn("W047", { 139 | line: data.line, 140 | char: data.char, 141 | data: [ data.value ] 142 | }); 143 | } 144 | 145 | if (/^00+/.test(data.value)) { 146 | // Multiple leading zeroes. 147 | linter.warn("W046", { 148 | line: data.line, 149 | char: data.char, 150 | data: [ data.value ] 151 | }); 152 | } 153 | }); 154 | 155 | // Warn about script URLs. 156 | 157 | linter.on("String", function style_scanJavaScriptURLs(data) { 158 | var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; 159 | 160 | if (linter.getOption("scripturl")) { 161 | return; 162 | } 163 | 164 | if (re.test(data.value)) { 165 | linter.warn("W107", { 166 | line: data.line, 167 | char: data.char 168 | }); 169 | } 170 | }); 171 | }; -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/mv.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // Prepare tmp/ 20 | shell.cp('resources/*', 'tmp'); 21 | 22 | // 23 | // Invalids 24 | // 25 | 26 | shell.mv(); 27 | assert.ok(shell.error()); 28 | 29 | shell.mv('file1'); 30 | assert.ok(shell.error()); 31 | 32 | shell.mv('-f'); 33 | assert.ok(shell.error()); 34 | 35 | shell.mv('-Z', 'tmp/file1', 'tmp/file1'); // option not supported 36 | assert.ok(shell.error()); 37 | assert.equal(fs.existsSync('tmp/file1'), true); 38 | 39 | shell.mv('asdfasdf', 'tmp'); // source does not exist 40 | assert.ok(shell.error()); 41 | assert.equal(numLines(shell.error()), 1); 42 | assert.equal(fs.existsSync('tmp/asdfasdf'), false); 43 | 44 | shell.mv('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist 45 | assert.ok(shell.error()); 46 | assert.equal(numLines(shell.error()), 2); 47 | assert.equal(fs.existsSync('tmp/asdfasdf1'), false); 48 | assert.equal(fs.existsSync('tmp/asdfasdf2'), false); 49 | 50 | shell.mv('asdfasdf1', 'asdfasdf2', 'tmp/file1'); // too many sources (dest is file) 51 | assert.ok(shell.error()); 52 | 53 | shell.mv('tmp/file1', 'tmp/file2'); // dest already exists 54 | assert.ok(shell.error()); 55 | 56 | shell.mv('tmp/file1', 'tmp/file2', 'tmp/a_file'); // too many sources (exist, but dest is file) 57 | assert.ok(shell.error()); 58 | assert.equal(fs.existsSync('tmp/a_file'), false); 59 | 60 | shell.mv('tmp/file*', 'tmp/file1'); // can't use wildcard when dest is file 61 | assert.ok(shell.error()); 62 | assert.equal(fs.existsSync('tmp/file1'), true); 63 | assert.equal(fs.existsSync('tmp/file2'), true); 64 | assert.equal(fs.existsSync('tmp/file1.js'), true); 65 | assert.equal(fs.existsSync('tmp/file2.js'), true); 66 | 67 | // 68 | // Valids 69 | // 70 | 71 | shell.cd('tmp'); 72 | 73 | // handles self OK 74 | shell.mkdir('tmp2'); 75 | shell.mv('*', 'tmp2'); // has to handle self (tmp2 --> tmp2) without throwing error 76 | assert.ok(shell.error()); // there's an error, but not fatal 77 | assert.equal(fs.existsSync('tmp2/file1'), true); // moved OK 78 | shell.mv('tmp2/*', '.'); // revert 79 | assert.equal(fs.existsSync('file1'), true); // moved OK 80 | 81 | shell.mv('file1', 'file3'); // one source 82 | assert.equal(shell.error(), null); 83 | assert.equal(fs.existsSync('file1'), false); 84 | assert.equal(fs.existsSync('file3'), true); 85 | shell.mv('file3', 'file1'); // revert 86 | assert.equal(shell.error(), null); 87 | assert.equal(fs.existsSync('file1'), true); 88 | 89 | // two sources 90 | shell.rm('-rf', 't'); 91 | shell.mkdir('-p', 't'); 92 | shell.mv('file1', 'file2', 't'); 93 | assert.equal(shell.error(), null); 94 | assert.equal(fs.existsSync('file1'), false); 95 | assert.equal(fs.existsSync('file2'), false); 96 | assert.equal(fs.existsSync('t/file1'), true); 97 | assert.equal(fs.existsSync('t/file2'), true); 98 | shell.mv('t/*', '.'); // revert 99 | assert.equal(fs.existsSync('file1'), true); 100 | assert.equal(fs.existsSync('file2'), true); 101 | 102 | // two sources, array style 103 | shell.rm('-rf', 't'); 104 | shell.mkdir('-p', 't'); 105 | shell.mv(['file1', 'file2'], 't'); // two sources 106 | assert.equal(shell.error(), null); 107 | assert.equal(fs.existsSync('file1'), false); 108 | assert.equal(fs.existsSync('file2'), false); 109 | assert.equal(fs.existsSync('t/file1'), true); 110 | assert.equal(fs.existsSync('t/file2'), true); 111 | shell.mv('t/*', '.'); // revert 112 | assert.equal(fs.existsSync('file1'), true); 113 | assert.equal(fs.existsSync('file2'), true); 114 | 115 | shell.mv('file*.js', 't'); // wildcard 116 | assert.equal(shell.error(), null); 117 | assert.equal(fs.existsSync('file1.js'), false); 118 | assert.equal(fs.existsSync('file2.js'), false); 119 | assert.equal(fs.existsSync('t/file1.js'), true); 120 | assert.equal(fs.existsSync('t/file2.js'), true); 121 | shell.mv('t/*', '.'); // revert 122 | assert.equal(fs.existsSync('file1.js'), true); 123 | assert.equal(fs.existsSync('file2.js'), true); 124 | 125 | shell.mv('-f', 'file1', 'file2'); // dest exists, but -f given 126 | assert.equal(shell.error(), null); 127 | assert.equal(fs.existsSync('file1'), false); 128 | assert.equal(fs.existsSync('file2'), true); 129 | 130 | shell.exit(123); 131 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lru-cache", 3 | "description": "A cache object that deletes the least-recently-used items.", 4 | "version": "2.3.1", 5 | "author": { 6 | "name": "Isaac Z. Schlueter", 7 | "email": "i@izs.me" 8 | }, 9 | "scripts": { 10 | "test": "tap test --gc" 11 | }, 12 | "main": "lib/lru-cache.js", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/isaacs/node-lru-cache.git" 16 | }, 17 | "devDependencies": { 18 | "tap": "", 19 | "weak": "" 20 | }, 21 | "license": { 22 | "type": "MIT", 23 | "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" 24 | }, 25 | "contributors": [ 26 | { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me" 29 | }, 30 | { 31 | "name": "Carlos Brito Lage", 32 | "email": "carlos@carloslage.net" 33 | }, 34 | { 35 | "name": "Marko Mikulicic", 36 | "email": "marko.mikulicic@isti.cnr.it" 37 | }, 38 | { 39 | "name": "Trent Mick", 40 | "email": "trentm@gmail.com" 41 | }, 42 | { 43 | "name": "Kevin O'Hara", 44 | "email": "kevinohara80@gmail.com" 45 | }, 46 | { 47 | "name": "Marco Rogers", 48 | "email": "marco.rogers@gmail.com" 49 | }, 50 | { 51 | "name": "Jesse Dailey", 52 | "email": "jesse.dailey@gmail.com" 53 | } 54 | ], 55 | "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", 56 | "readmeFilename": "README.md", 57 | "bugs": { 58 | "url": "https://github.com/isaacs/node-lru-cache/issues" 59 | }, 60 | "_id": "lru-cache@2.3.1", 61 | "_from": "lru-cache@2" 62 | } 63 | -------------------------------------------------------------------------------- /Support/node_modules/cli/node_modules/glob/test/00-setup.js: -------------------------------------------------------------------------------- 1 | // just a little pre-run script to set up the fixtures. 2 | // zz-finish cleans it up 3 | 4 | var mkdirp = require("mkdirp") 5 | var path = require("path") 6 | var i = 0 7 | var tap = require("tap") 8 | var fs = require("fs") 9 | var rimraf = require("rimraf") 10 | 11 | var files = 12 | [ "a/.abcdef/x/y/z/a" 13 | , "a/abcdef/g/h" 14 | , "a/abcfed/g/h" 15 | , "a/b/c/d" 16 | , "a/bc/e/f" 17 | , "a/c/d/c/b" 18 | , "a/cb/e/f" 19 | ] 20 | 21 | var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") 22 | var symlinkFrom = "../.." 23 | 24 | files = files.map(function (f) { 25 | return path.resolve(__dirname, f) 26 | }) 27 | 28 | tap.test("remove fixtures", function (t) { 29 | rimraf(path.resolve(__dirname, "a"), function (er) { 30 | t.ifError(er, "remove fixtures") 31 | t.end() 32 | }) 33 | }) 34 | 35 | files.forEach(function (f) { 36 | tap.test(f, function (t) { 37 | var d = path.dirname(f) 38 | mkdirp(d, 0755, function (er) { 39 | if (er) { 40 | t.fail(er) 41 | return t.bailout() 42 | } 43 | fs.writeFile(f, "i like tests", function (er) { 44 | t.ifError(er, "make file") 45 | t.end() 46 | }) 47 | }) 48 | }) 49 | }) 50 | 51 | if (process.platform !== "win32") { 52 | tap.test("symlinky", function (t) { 53 | var d = path.dirname(symlinkTo) 54 | console.error("mkdirp", d) 55 | mkdirp(d, 0755, function (er) { 56 | t.ifError(er) 57 | fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { 58 | t.ifError(er, "make symlink") 59 | t.end() 60 | }) 61 | }) 62 | }) 63 | } 64 | 65 | ;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { 66 | w = "/tmp/glob-test/" + w 67 | tap.test("create " + w, function (t) { 68 | mkdirp(w, function (er) { 69 | if (er) 70 | throw er 71 | t.pass(w) 72 | t.end() 73 | }) 74 | }) 75 | }) 76 | 77 | 78 | // generate the bash pattern test-fixtures if possible 79 | if (process.platform === "win32" || !process.env.TEST_REGEN) { 80 | console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") 81 | return 82 | } 83 | 84 | var spawn = require("child_process").spawn; 85 | var globs = 86 | // put more patterns here. 87 | // anything that would be directly in / should be in /tmp/glob-test 88 | ["test/a/*/+(c|g)/./d" 89 | ,"test/a/**/[cg]/../[cg]" 90 | ,"test/a/{b,c,d,e,f}/**/g" 91 | ,"test/a/b/**" 92 | ,"test/**/g" 93 | ,"test/a/abc{fed,def}/g/h" 94 | ,"test/a/abc{fed/g,def}/**/" 95 | ,"test/a/abc{fed/g,def}/**///**/" 96 | ,"test/**/a/**/" 97 | ,"test/+(a|b|c)/a{/,bc*}/**" 98 | ,"test/*/*/*/f" 99 | ,"test/**/f" 100 | ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" 101 | ,"{./*/*,/tmp/glob-test/*}" 102 | ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! 103 | ,"test/a/!(symlink)/**" 104 | ] 105 | var bashOutput = {} 106 | var fs = require("fs") 107 | 108 | globs.forEach(function (pattern) { 109 | tap.test("generate fixture " + pattern, function (t) { 110 | var cmd = "shopt -s globstar && " + 111 | "shopt -s extglob && " + 112 | "shopt -s nullglob && " + 113 | // "shopt >&2; " + 114 | "eval \'for i in " + pattern + "; do echo $i; done\'" 115 | var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) 116 | var out = [] 117 | cp.stdout.on("data", function (c) { 118 | out.push(c) 119 | }) 120 | cp.stderr.pipe(process.stderr) 121 | cp.on("close", function (code) { 122 | out = flatten(out) 123 | if (!out) 124 | out = [] 125 | else 126 | out = cleanResults(out.split(/\r*\n/)) 127 | 128 | bashOutput[pattern] = out 129 | t.notOk(code, "bash test should finish nicely") 130 | t.end() 131 | }) 132 | }) 133 | }) 134 | 135 | tap.test("save fixtures", function (t) { 136 | var fname = path.resolve(__dirname, "bash-results.json") 137 | var data = JSON.stringify(bashOutput, null, 2) + "\n" 138 | fs.writeFile(fname, data, function (er) { 139 | t.ifError(er) 140 | t.end() 141 | }) 142 | }) 143 | 144 | function cleanResults (m) { 145 | // normalize discrepancies in ordering, duplication, 146 | // and ending slashes. 147 | return m.map(function (m) { 148 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 149 | }).sort(alphasort).reduce(function (set, f) { 150 | if (f !== set[set.length - 1]) set.push(f) 151 | return set 152 | }, []).sort(alphasort).map(function (f) { 153 | // de-windows 154 | return (process.platform !== 'win32') ? f 155 | : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') 156 | }) 157 | } 158 | 159 | function flatten (chunks) { 160 | var s = 0 161 | chunks.forEach(function (c) { s += c.length }) 162 | var out = new Buffer(s) 163 | s = 0 164 | chunks.forEach(function (c) { 165 | c.copy(out, s) 166 | s += c.length 167 | }) 168 | 169 | return out.toString().trim() 170 | } 171 | 172 | function alphasort (a, b) { 173 | a = a.toLowerCase() 174 | b = b.toLowerCase() 175 | return a > b ? 1 : a < b ? -1 : 0 176 | } 177 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/cp.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | function numLines(str) { 13 | return typeof str === 'string' ? str.match(/\n/g).length : 0; 14 | } 15 | 16 | shell.rm('-rf', 'tmp'); 17 | shell.mkdir('tmp'); 18 | 19 | // 20 | // Invalids 21 | // 22 | 23 | shell.cp(); 24 | assert.ok(shell.error()); 25 | 26 | shell.cp('file1'); 27 | assert.ok(shell.error()); 28 | 29 | shell.cp('-f'); 30 | assert.ok(shell.error()); 31 | 32 | shell.rm('-rf', 'tmp/*'); 33 | shell.cp('-@', 'resources/file1', 'tmp/file1'); // option not supported, files OK 34 | assert.ok(shell.error()); 35 | assert.equal(fs.existsSync('tmp/file1'), false); 36 | 37 | shell.cp('-Z', 'asdfasdf', 'tmp/file2'); // option not supported, files NOT OK 38 | assert.ok(shell.error()); 39 | assert.equal(fs.existsSync('tmp/file2'), false); 40 | 41 | shell.cp('asdfasdf', 'tmp'); // source does not exist 42 | assert.ok(shell.error()); 43 | assert.equal(numLines(shell.error()), 1); 44 | assert.equal(fs.existsSync('tmp/asdfasdf'), false); 45 | 46 | shell.cp('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist 47 | assert.ok(shell.error()); 48 | assert.equal(numLines(shell.error()), 2); 49 | assert.equal(fs.existsSync('tmp/asdfasdf1'), false); 50 | assert.equal(fs.existsSync('tmp/asdfasdf2'), false); 51 | 52 | shell.cp('asdfasdf1', 'asdfasdf2', 'resources/file1'); // too many sources (dest is file) 53 | assert.ok(shell.error()); 54 | 55 | shell.cp('resources/file1', 'resources/file2'); // dest already exists 56 | assert.ok(shell.error()); 57 | 58 | shell.cp('resources/file1', 'resources/file2', 'tmp/a_file'); // too many sources 59 | assert.ok(shell.error()); 60 | assert.equal(fs.existsSync('tmp/a_file'), false); 61 | 62 | // 63 | // Valids 64 | // 65 | 66 | // simple - to dir 67 | shell.cp('resources/file1', 'tmp'); 68 | assert.equal(shell.error(), null); 69 | assert.equal(fs.existsSync('tmp/file1'), true); 70 | 71 | // simple - to file 72 | shell.cp('resources/file2', 'tmp/file2'); 73 | assert.equal(shell.error(), null); 74 | assert.equal(fs.existsSync('tmp/file2'), true); 75 | 76 | // simple - file list 77 | shell.rm('-rf', 'tmp/*'); 78 | shell.cp('resources/file1', 'resources/file2', 'tmp'); 79 | assert.equal(shell.error(), null); 80 | assert.equal(fs.existsSync('tmp/file1'), true); 81 | assert.equal(fs.existsSync('tmp/file2'), true); 82 | 83 | // simple - file list, array syntax 84 | shell.rm('-rf', 'tmp/*'); 85 | shell.cp(['resources/file1', 'resources/file2'], 'tmp'); 86 | assert.equal(shell.error(), null); 87 | assert.equal(fs.existsSync('tmp/file1'), true); 88 | assert.equal(fs.existsSync('tmp/file2'), true); 89 | 90 | shell.cp('resources/file2', 'tmp/file3'); 91 | assert.equal(fs.existsSync('tmp/file3'), true); 92 | shell.cp('-f', 'resources/file2', 'tmp/file3'); // file exists, but -f specified 93 | assert.equal(shell.error(), null); 94 | assert.equal(fs.existsSync('tmp/file3'), true); 95 | 96 | // wildcard 97 | shell.rm('tmp/file1', 'tmp/file2'); 98 | shell.cp('resources/file*', 'tmp'); 99 | assert.equal(shell.error(), null); 100 | assert.equal(fs.existsSync('tmp/file1'), true); 101 | assert.equal(fs.existsSync('tmp/file2'), true); 102 | 103 | //recursive, nothing exists 104 | shell.rm('-rf', 'tmp/*'); 105 | shell.cp('-R', 'resources/cp', 'tmp'); 106 | assert.equal(shell.error(), null); 107 | assert.equal(shell.ls('-R', 'resources/cp') + '', shell.ls('-R', 'tmp/cp') + ''); 108 | 109 | //recursive, nothing exists, source ends in '/' (see Github issue #15) 110 | shell.rm('-rf', 'tmp/*'); 111 | shell.cp('-R', 'resources/cp/', 'tmp/'); 112 | assert.equal(shell.error(), null); 113 | assert.equal(shell.ls('-R', 'resources/cp') + '', shell.ls('-R', 'tmp') + ''); 114 | 115 | //recursive, everything exists, no force flag 116 | shell.rm('-rf', 'tmp/*'); 117 | shell.cp('-R', 'resources/cp', 'tmp'); 118 | shell.cp('-R', 'resources/cp', 'tmp'); 119 | assert.equal(shell.error(), null); // crash test only 120 | 121 | //recursive, everything exists, with force flag 122 | shell.rm('-rf', 'tmp/*'); 123 | shell.cp('-R', 'resources/cp', 'tmp'); 124 | 'changing things around'.to('tmp/cp/dir_a/z'); 125 | assert.notEqual(shell.cat('resources/cp/dir_a/z'), shell.cat('tmp/cp/dir_a/z')); // before cp 126 | shell.cp('-Rf', 'resources/cp', 'tmp'); 127 | assert.equal(shell.error(), null); 128 | assert.equal(shell.cat('resources/cp/dir_a/z'), shell.cat('tmp/cp/dir_a/z')); // after cp 129 | 130 | //recursive, creates dest dir since it's only one level deep (see Github issue #44) 131 | shell.rm('-rf', 'tmp/*'); 132 | shell.cp('-r', 'resources/issue44/*', 'tmp/dir2'); 133 | assert.equal(shell.error(), null); 134 | assert.equal(shell.ls('-R', 'resources/issue44') + '', shell.ls('-R', 'tmp/dir2') + ''); 135 | assert.equal(shell.cat('resources/issue44/main.js'), shell.cat('tmp/dir2/main.js')); 136 | 137 | //recursive, does *not* create dest dir since it's too deep (see Github issue #44) 138 | shell.rm('-rf', 'tmp/*'); 139 | shell.cp('-r', 'resources/issue44/*', 'tmp/dir2/dir3'); 140 | assert.ok(shell.error()); 141 | assert.equal(fs.existsSync('tmp/dir2'), false); 142 | 143 | shell.exit(123); 144 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/rm.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | shell.rm('-rf', 'tmp'); 13 | shell.mkdir('tmp'); 14 | 15 | // 16 | // Invalids 17 | // 18 | 19 | shell.rm(); 20 | assert.ok(shell.error()); 21 | 22 | shell.rm('asdfasdf'); // file does not exist 23 | assert.ok(shell.error()); 24 | 25 | shell.rm('-f'); // no file 26 | assert.ok(shell.error()); 27 | 28 | shell.rm('-@', 'resources/file1'); // invalid option 29 | assert.ok(shell.error()); 30 | assert.equal(fs.existsSync('resources/file1'), true); 31 | 32 | // 33 | // Valids 34 | // 35 | 36 | // file does not exist, but -f specified 37 | shell.rm('-f', 'asdfasdf'); 38 | assert.equal(shell.error(), null); 39 | 40 | // simple rm 41 | shell.cp('-f', 'resources/file1', 'tmp/file1'); 42 | assert.equal(fs.existsSync('tmp/file1'), true); 43 | shell.rm('tmp/file1'); 44 | assert.equal(shell.error(), null); 45 | assert.equal(fs.existsSync('tmp/file1'), false); 46 | 47 | // recursive dir removal - small-caps '-r' 48 | shell.mkdir('-p', 'tmp/a/b/c'); 49 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 50 | shell.rm('-rf', 'tmp/a'); 51 | assert.equal(shell.error(), null); 52 | assert.equal(fs.existsSync('tmp/a'), false); 53 | 54 | // recursive dir removal - capital '-R' 55 | shell.mkdir('-p', 'tmp/a/b/c'); 56 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 57 | shell.rm('-Rf', 'tmp/a'); 58 | assert.equal(shell.error(), null); 59 | assert.equal(fs.existsSync('tmp/a'), false); 60 | 61 | // recursive dir removal - absolute path 62 | shell.mkdir('-p', 'tmp/a/b/c'); 63 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 64 | shell.rm('-Rf', path.resolve('./tmp/a')); 65 | assert.equal(shell.error(), null); 66 | assert.equal(fs.existsSync('tmp/a'), false); 67 | 68 | // wildcard 69 | shell.cp('-f', 'resources/file*', 'tmp'); 70 | assert.equal(shell.error(), null); 71 | assert.equal(fs.existsSync('tmp/file1'), true); 72 | assert.equal(fs.existsSync('tmp/file2'), true); 73 | assert.equal(fs.existsSync('tmp/file1.js'), true); 74 | assert.equal(fs.existsSync('tmp/file2.js'), true); 75 | shell.rm('tmp/file*'); 76 | assert.equal(shell.error(), null); 77 | assert.equal(fs.existsSync('tmp/file1'), false); 78 | assert.equal(fs.existsSync('tmp/file2'), false); 79 | assert.equal(fs.existsSync('tmp/file1.js'), false); 80 | assert.equal(fs.existsSync('tmp/file2.js'), false); 81 | 82 | // recursive dir removal 83 | shell.mkdir('-p', 'tmp/a/b/c'); 84 | shell.mkdir('-p', 'tmp/b'); 85 | shell.mkdir('-p', 'tmp/c'); 86 | shell.mkdir('-p', 'tmp/.hidden'); 87 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 88 | assert.equal(fs.existsSync('tmp/b'), true); 89 | assert.equal(fs.existsSync('tmp/c'), true); 90 | assert.equal(fs.existsSync('tmp/.hidden'), true); 91 | shell.rm('-rf', 'tmp/*'); 92 | assert.equal(shell.error(), null); 93 | var contents = fs.readdirSync('tmp'); 94 | assert.equal(contents.length, 1); 95 | assert.equal(contents[0], '.hidden'); // shouldn't remove hiddden if no .* given 96 | 97 | // recursive dir removal 98 | shell.mkdir('-p', 'tmp/a/b/c'); 99 | shell.mkdir('-p', 'tmp/b'); 100 | shell.mkdir('-p', 'tmp/c'); 101 | shell.mkdir('-p', 'tmp/.hidden'); 102 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 103 | assert.equal(fs.existsSync('tmp/b'), true); 104 | assert.equal(fs.existsSync('tmp/c'), true); 105 | assert.equal(fs.existsSync('tmp/.hidden'), true); 106 | shell.rm('-rf', 'tmp/*', 'tmp/.*'); 107 | assert.equal(shell.error(), null); 108 | var contents = fs.readdirSync('tmp'); 109 | assert.equal(contents.length, 0); 110 | 111 | // recursive dir removal - array-syntax 112 | shell.mkdir('-p', 'tmp/a/b/c'); 113 | shell.mkdir('-p', 'tmp/b'); 114 | shell.mkdir('-p', 'tmp/c'); 115 | shell.mkdir('-p', 'tmp/.hidden'); 116 | assert.equal(fs.existsSync('tmp/a/b/c'), true); 117 | assert.equal(fs.existsSync('tmp/b'), true); 118 | assert.equal(fs.existsSync('tmp/c'), true); 119 | assert.equal(fs.existsSync('tmp/.hidden'), true); 120 | shell.rm('-rf', ['tmp/*', 'tmp/.*']); 121 | assert.equal(shell.error(), null); 122 | var contents = fs.readdirSync('tmp'); 123 | assert.equal(contents.length, 0); 124 | 125 | // removal of a read-only file (unforced) 126 | shell.mkdir('-p', 'tmp/readonly'); 127 | 'asdf'.to('tmp/readonly/file1'); 128 | fs.chmodSync('tmp/readonly/file1', '0444'); // -r--r--r-- 129 | shell.rm('tmp/readonly/file1'); 130 | assert.equal(fs.existsSync('tmp/readonly/file1'), true); // bash's rm always asks before removing read-only files 131 | // here we just assume "no" 132 | 133 | // removal of a read-only file (forced) 134 | shell.mkdir('-p', 'tmp/readonly'); 135 | 'asdf'.to('tmp/readonly/file2'); 136 | fs.chmodSync('tmp/readonly/file2', '0444'); // -r--r--r-- 137 | shell.rm('-f', 'tmp/readonly/file2'); 138 | assert.equal(fs.existsSync('tmp/readonly/file2'), false); 139 | 140 | // removal of a tree containing read-only files (unforced) 141 | shell.mkdir('-p', 'tmp/tree2'); 142 | 'asdf'.to('tmp/tree2/file1'); 143 | 'asdf'.to('tmp/tree2/file2'); 144 | fs.chmodSync('tmp/tree2/file1', '0444'); // -r--r--r-- 145 | shell.rm('-r', 'tmp/tree2'); 146 | assert.equal(fs.existsSync('tmp/tree2/file1'), true); 147 | assert.equal(fs.existsSync('tmp/tree2/file2'), false); 148 | 149 | // removal of a tree containing read-only files (forced) 150 | shell.mkdir('-p', 'tmp/tree'); 151 | 'asdf'.to('tmp/tree/file1'); 152 | 'asdf'.to('tmp/tree/file2'); 153 | fs.chmodSync('tmp/tree/file1', '0444'); // -r--r--r-- 154 | shell.rm('-rf', 'tmp/tree'); 155 | assert.equal(fs.existsSync('tmp/tree'), false); 156 | 157 | // removal of a sub-tree containing read-only and hidden files - rm('dir/*') 158 | shell.mkdir('-p', 'tmp/tree3'); 159 | shell.mkdir('-p', 'tmp/tree3/subtree'); 160 | shell.mkdir('-p', 'tmp/tree3/.hidden'); 161 | 'asdf'.to('tmp/tree3/subtree/file'); 162 | 'asdf'.to('tmp/tree3/.hidden/file'); 163 | 'asdf'.to('tmp/tree3/file'); 164 | fs.chmodSync('tmp/tree3/file', '0444'); // -r--r--r-- 165 | fs.chmodSync('tmp/tree3/subtree/file', '0444'); // -r--r--r-- 166 | fs.chmodSync('tmp/tree3/.hidden/file', '0444'); // -r--r--r-- 167 | shell.rm('-rf', 'tmp/tree3/*', 'tmp/tree3/.*'); // erase dir contents 168 | assert.equal(shell.ls('tmp/tree3').length, 0); 169 | 170 | // removal of a sub-tree containing read-only and hidden files - rm('dir') 171 | shell.mkdir('-p', 'tmp/tree4'); 172 | shell.mkdir('-p', 'tmp/tree4/subtree'); 173 | shell.mkdir('-p', 'tmp/tree4/.hidden'); 174 | 'asdf'.to('tmp/tree4/subtree/file'); 175 | 'asdf'.to('tmp/tree4/.hidden/file'); 176 | 'asdf'.to('tmp/tree4/file'); 177 | fs.chmodSync('tmp/tree4/file', '0444'); // -r--r--r-- 178 | fs.chmodSync('tmp/tree4/subtree/file', '0444'); // -r--r--r-- 179 | fs.chmodSync('tmp/tree4/.hidden/file', '0444'); // -r--r--r-- 180 | shell.rm('-rf', 'tmp/tree4'); // erase dir contents 181 | assert.equal(fs.existsSync('tmp/tree4'), false); 182 | 183 | shell.exit(123); 184 | -------------------------------------------------------------------------------- /Support/node_modules/cli/README.md: -------------------------------------------------------------------------------- 1 | **cli is a toolkit for rapidly building command line apps - it includes:** 2 | 3 | - Full featured opts/args parser 4 | - Plugin support for adding common options and switches 5 | - Helper methods for working with input/output and spawning child processes 6 | - Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js) 7 | - Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js) 8 | 9 | Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app. 10 | 11 | ## Example apps 12 | 13 | ### sort.js 14 | 15 | ```javascript 16 | #!/usr/bin/env node 17 | require('cli').withStdinLines(function(lines, newline) { 18 | this.output(lines.sort().join(newline)); 19 | }); 20 | ``` 21 | 22 | Try it out 23 | 24 | ```bash 25 | $ ./sort.js < input.txt 26 | ``` 27 | 28 | Let's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!) 29 | 30 | ```javascript 31 | var cli = require('cli'), options = cli.parse(); 32 | 33 | cli.withStdinLines(function(lines, newline) { 34 | lines.sort(!options.n ? null : function(a, b) { 35 | return parseInt(a) > parseInt(b); 36 | }); 37 | if (options.r) lines.reverse(); 38 | this.output(lines.join(newline)); 39 | }); 40 | ``` 41 | 42 | ### static.js 43 | 44 | Let's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon` 45 | 46 | ```javascript 47 | var cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins 48 | 49 | cli.parse({ 50 | log: ['l', 'Enable logging'], 51 | port: ['p', 'Listen on this port', 'number', 8080], 52 | serve: [false, 'Serve static files from PATH', 'path', './public'] 53 | }); 54 | 55 | cli.main(function(args, options) { 56 | var server, middleware = []; 57 | 58 | if (options.log) { 59 | this.debug('Enabling logging'); 60 | middleware.push(require('creationix/log')()); 61 | } 62 | 63 | this.debug('Serving files from ' + options.serve); 64 | middleware.push(require('creationix/static')('/', options.serve, 'index.html')); 65 | 66 | server = this.createServer(middleware).listen(options.port); 67 | 68 | this.ok('Listening on port ' + options.port); 69 | }); 70 | ``` 71 | 72 | To output usage information 73 | 74 | ```bash 75 | $ ./static.js --help 76 | ``` 77 | 78 | To create a daemon that serves files from */tmp*, run 79 | 80 | ```bash 81 | $ ./static.js -ld --serve=/tmp 82 | ``` 83 | 84 | For more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples) 85 | 86 | ## Helper methods 87 | 88 | cli has methods that collect stdin (newline is autodetected as \n or \r\n) 89 | 90 | ```javascript 91 | cli.withStdin(callback); //callback receives stdin as a string 92 | cli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline) 93 | ``` 94 | 95 | cli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). 96 | 97 | ```javascript 98 | cli.withInput(file, function (line, newline, eof) { 99 | if (!eof) { 100 | this.output(line + newline); 101 | } 102 | }); 103 | ``` 104 | 105 | *Note: `file` can be omitted if you want to work with stdin* 106 | 107 | To output a progress bar, call 108 | 109 | ```javascript 110 | cli.progress(progress); //Where 0 <= progress <= 1 111 | ``` 112 | 113 | To spawn a child process, use 114 | 115 | ```javascript 116 | cli.exec(cmd, callback); //callback receives the output of the process (split into lines) 117 | ``` 118 | 119 | cli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer) 120 | 121 | ## Plugins 122 | 123 | Plugins are a way of adding common opts and can be enabled using 124 | 125 | ```javascript 126 | cli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method 127 | ``` 128 | 129 | **help** - *enabled by default* 130 | 131 | Adds `-h,--help` to output auto-generated usage information 132 | 133 | **version** 134 | 135 | Adds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json* 136 | 137 | To set your own app name and version, use `cli.setApp(app_name, version)` 138 | 139 | **status** 140 | 141 | Adds options to show/hide the stylized status messages that are output to the console when using one of these methods 142 | 143 | ```javascript 144 | cli.debug(msg); //Only shown when using --debug 145 | cli.error(msg); 146 | cli.fatal(msg); //Exits the process after outputting msg 147 | cli.info(msg); 148 | cli.ok(msg); 149 | ``` 150 | 151 | `-k,--no-color` will omit ANSI color escapes from the output 152 | 153 | **glob** - *requires* `npm install glob` 154 | 155 | Enables glob matching of arguments 156 | 157 | **daemon** - *requires* `npm install daemon` 158 | 159 | Adds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon 160 | 161 | `ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr) 162 | 163 | **timeout** 164 | 165 | Adds `-t,--timeout N` to exit the process after N seconds with an error 166 | 167 | **catchall** 168 | 169 | Adds `-c,--catch` to catch and output uncaughtExceptions and resume execution 170 | 171 | *Note: Plugins are automatically disabled if an option or switch of the same name is already defined* 172 | 173 | ## LICENSE 174 | 175 | (MIT license) 176 | 177 | Copyright (c) 2010 Chris O'Hara 178 | 179 | Permission is hereby granted, free of charge, to any person obtaining 180 | a copy of this software and associated documentation files (the 181 | "Software"), to deal in the Software without restriction, including 182 | without limitation the rights to use, copy, modify, merge, publish, 183 | distribute, sublicense, and/or sell copies of the Software, and to 184 | permit persons to whom the Software is furnished to do so, subject to 185 | the following conditions: 186 | 187 | The above copyright notice and this permission notice shall be 188 | included in all copies or substantial portions of the Software. 189 | 190 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 191 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 192 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 193 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 194 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 195 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 196 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 197 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js: -------------------------------------------------------------------------------- 1 | ;(function () { // closure for web browsers 2 | 3 | if (typeof module === 'object' && module.exports) { 4 | module.exports = LRUCache 5 | } else { 6 | // just set the global for non-node platforms. 7 | this.LRUCache = LRUCache 8 | } 9 | 10 | function hOP (obj, key) { 11 | return Object.prototype.hasOwnProperty.call(obj, key) 12 | } 13 | 14 | function naiveLength () { return 1 } 15 | 16 | function LRUCache (options) { 17 | if (!(this instanceof LRUCache)) { 18 | return new LRUCache(options) 19 | } 20 | 21 | var max 22 | if (typeof options === 'number') { 23 | max = options 24 | options = { max: max } 25 | } 26 | 27 | if (!options) options = {} 28 | 29 | max = options.max 30 | 31 | var lengthCalculator = options.length || naiveLength 32 | 33 | if (typeof lengthCalculator !== "function") { 34 | lengthCalculator = naiveLength 35 | } 36 | 37 | if (!max || !(typeof max === "number") || max <= 0 ) { 38 | // a little bit silly. maybe this should throw? 39 | max = Infinity 40 | } 41 | 42 | var allowStale = options.stale || false 43 | 44 | var maxAge = options.maxAge || null 45 | 46 | var dispose = options.dispose 47 | 48 | var cache = Object.create(null) // hash of items by key 49 | , lruList = Object.create(null) // list of items in order of use recency 50 | , mru = 0 // most recently used 51 | , lru = 0 // least recently used 52 | , length = 0 // number of items in the list 53 | , itemCount = 0 54 | 55 | 56 | // resize the cache when the max changes. 57 | Object.defineProperty(this, "max", 58 | { set : function (mL) { 59 | if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity 60 | max = mL 61 | // if it gets above double max, trim right away. 62 | // otherwise, do it whenever it's convenient. 63 | if (length > max) trim() 64 | } 65 | , get : function () { return max } 66 | , enumerable : true 67 | }) 68 | 69 | // resize the cache when the lengthCalculator changes. 70 | Object.defineProperty(this, "lengthCalculator", 71 | { set : function (lC) { 72 | if (typeof lC !== "function") { 73 | lengthCalculator = naiveLength 74 | length = itemCount 75 | for (var key in cache) { 76 | cache[key].length = 1 77 | } 78 | } else { 79 | lengthCalculator = lC 80 | length = 0 81 | for (var key in cache) { 82 | cache[key].length = lengthCalculator(cache[key].value) 83 | length += cache[key].length 84 | } 85 | } 86 | 87 | if (length > max) trim() 88 | } 89 | , get : function () { return lengthCalculator } 90 | , enumerable : true 91 | }) 92 | 93 | Object.defineProperty(this, "length", 94 | { get : function () { return length } 95 | , enumerable : true 96 | }) 97 | 98 | 99 | Object.defineProperty(this, "itemCount", 100 | { get : function () { return itemCount } 101 | , enumerable : true 102 | }) 103 | 104 | this.forEach = function (fn, thisp) { 105 | thisp = thisp || this 106 | var i = 0; 107 | for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { 108 | i++ 109 | var hit = lruList[k] 110 | if (maxAge && (Date.now() - hit.now > maxAge)) { 111 | del(hit) 112 | if (!allowStale) hit = undefined 113 | } 114 | if (hit) { 115 | fn.call(thisp, hit.value, hit.key, this) 116 | } 117 | } 118 | } 119 | 120 | this.keys = function () { 121 | var keys = new Array(itemCount) 122 | var i = 0 123 | for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { 124 | var hit = lruList[k] 125 | keys[i++] = hit.key 126 | } 127 | return keys 128 | } 129 | 130 | this.values = function () { 131 | var values = new Array(itemCount) 132 | var i = 0 133 | for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { 134 | var hit = lruList[k] 135 | values[i++] = hit.value 136 | } 137 | return values 138 | } 139 | 140 | this.reset = function () { 141 | if (dispose) { 142 | for (var k in cache) { 143 | dispose(k, cache[k].value) 144 | } 145 | } 146 | cache = {} 147 | lruList = {} 148 | lru = 0 149 | mru = 0 150 | length = 0 151 | itemCount = 0 152 | } 153 | 154 | // Provided for debugging/dev purposes only. No promises whatsoever that 155 | // this API stays stable. 156 | this.dump = function () { 157 | return cache 158 | } 159 | 160 | this.dumpLru = function () { 161 | return lruList 162 | } 163 | 164 | this.set = function (key, value) { 165 | if (hOP(cache, key)) { 166 | // dispose of the old one before overwriting 167 | if (dispose) dispose(key, cache[key].value) 168 | if (maxAge) cache[key].now = Date.now() 169 | cache[key].value = value 170 | this.get(key) 171 | return true 172 | } 173 | 174 | var len = lengthCalculator(value) 175 | var age = maxAge ? Date.now() : 0 176 | var hit = new Entry(key, value, mru++, len, age) 177 | 178 | // oversized objects fall out of cache automatically. 179 | if (hit.length > max) { 180 | if (dispose) dispose(key, value) 181 | return false 182 | } 183 | 184 | length += hit.length 185 | lruList[hit.lu] = cache[key] = hit 186 | itemCount ++ 187 | 188 | if (length > max) trim() 189 | return true 190 | } 191 | 192 | this.has = function (key) { 193 | if (!hOP(cache, key)) return false 194 | var hit = cache[key] 195 | if (maxAge && (Date.now() - hit.now > maxAge)) { 196 | return false 197 | } 198 | return true 199 | } 200 | 201 | this.get = function (key) { 202 | return get(key, true) 203 | } 204 | 205 | this.peek = function (key) { 206 | return get(key, false) 207 | } 208 | 209 | function get (key, doUse) { 210 | var hit = cache[key] 211 | if (hit) { 212 | if (maxAge && (Date.now() - hit.now > maxAge)) { 213 | del(hit) 214 | if (!allowStale) hit = undefined 215 | } else { 216 | if (doUse) use(hit) 217 | } 218 | if (hit) hit = hit.value 219 | } 220 | return hit 221 | } 222 | 223 | function use (hit) { 224 | shiftLU(hit) 225 | hit.lu = mru ++ 226 | lruList[hit.lu] = hit 227 | } 228 | 229 | this.del = function (key) { 230 | del(cache[key]) 231 | } 232 | 233 | function trim () { 234 | while (lru < mru && length > max) 235 | del(lruList[lru]) 236 | } 237 | 238 | function shiftLU(hit) { 239 | delete lruList[ hit.lu ] 240 | while (lru < mru && !lruList[lru]) lru ++ 241 | } 242 | 243 | function del(hit) { 244 | if (hit) { 245 | if (dispose) dispose(hit.key, hit.value) 246 | length -= hit.length 247 | itemCount -- 248 | delete cache[ hit.key ] 249 | shiftLU(hit) 250 | } 251 | } 252 | } 253 | 254 | // classy, since V8 prefers predictable objects. 255 | function Entry (key, value, mru, len, age) { 256 | this.key = key 257 | this.value = value 258 | this.lu = mru 259 | this.length = len 260 | this.now = age 261 | } 262 | 263 | })() 264 | -------------------------------------------------------------------------------- /Support/node_modules/cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cli", 3 | "description": "A tool for rapidly building command line apps", 4 | "version": "0.4.5", 5 | "homepage": "http://github.com/chriso/cli", 6 | "keywords": [ 7 | "cli", 8 | "command line", 9 | "opts", 10 | "parseopt", 11 | "opt", 12 | "args", 13 | "console", 14 | "argsparse", 15 | "optparse", 16 | "daemon", 17 | "autocomplete", 18 | "command", 19 | "autocompletion" 20 | ], 21 | "author": { 22 | "name": "Chris O'Hara", 23 | "email": "cohara87@gmail.com" 24 | }, 25 | "main": "cli.js", 26 | "bugs": { 27 | "url": "http://github.com/chriso/cli/issues" 28 | }, 29 | "repository": { 30 | "type": "git", 31 | "url": "http://github.com/chriso/cli.git" 32 | }, 33 | "dependencies": { 34 | "glob": ">= 3.1.4" 35 | }, 36 | "contributors": [ 37 | { 38 | "name": "Douglas Meyer" 39 | } 40 | ], 41 | "engines": { 42 | "node": ">=0.2.5" 43 | }, 44 | "licenses": [ 45 | { 46 | "type": "MIT" 47 | } 48 | ], 49 | "readme": "**cli is a toolkit for rapidly building command line apps - it includes:**\n\n- Full featured opts/args parser\n- Plugin support for adding common options and switches\n- Helper methods for working with input/output and spawning child processes\n- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js)\n- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js)\n\nInstall using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli-min.js) with your app.\n\n## Example apps\n\n### sort.js\n\n```javascript\n#!/usr/bin/env node\nrequire('cli').withStdinLines(function(lines, newline) {\n this.output(lines.sort().join(newline));\n});\n```\n\nTry it out\n\n```bash\n$ ./sort.js < input.txt\n```\n\nLet's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!)\n\n```javascript\nvar cli = require('cli'), options = cli.parse();\n\ncli.withStdinLines(function(lines, newline) {\n lines.sort(!options.n ? null : function(a, b) {\n return parseInt(a) > parseInt(b);\n });\n if (options.r) lines.reverse();\n this.output(lines.join(newline));\n});\n```\n\n### static.js\n\nLet's create a static file server with daemon support to see the opts parser + plugins in use - note: this requires `npm install creationix daemon`\n\n```javascript\nvar cli = require('cli').enable('daemon', 'status'); //Enable 2 plugins\n\ncli.parse({\n log: ['l', 'Enable logging'],\n port: ['p', 'Listen on this port', 'number', 8080],\n serve: [false, 'Serve static files from PATH', 'path', './public']\n});\n\ncli.main(function(args, options) {\n var server, middleware = [];\n\n if (options.log) {\n this.debug('Enabling logging');\n middleware.push(require('creationix/log')());\n }\n\n this.debug('Serving files from ' + options.serve);\n middleware.push(require('creationix/static')('/', options.serve, 'index.html'));\n\n server = this.createServer(middleware).listen(options.port);\n\n this.ok('Listening on port ' + options.port);\n});\n```\n\nTo output usage information\n\n```bash\n$ ./static.js --help\n```\n\nTo create a daemon that serves files from */tmp*, run\n\n```bash\n$ ./static.js -ld --serve=/tmp\n```\n\nFor more examples, see [./examples](https://github.com/chriso/cli/tree/master/examples)\n\n## Helper methods\n\ncli has methods that collect stdin (newline is autodetected as \\n or \\r\\n)\n\n```javascript\ncli.withStdin(callback); //callback receives stdin as a string\ncli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline)\n```\n\ncli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example). \n\n```javascript\ncli.withInput(file, function (line, newline, eof) {\n if (!eof) {\n this.output(line + newline);\n }\n});\n```\n\n*Note: `file` can be omitted if you want to work with stdin*\n\nTo output a progress bar, call\n\n```javascript\ncli.progress(progress); //Where 0 <= progress <= 1\n```\n\nTo spawn a child process, use\n\n```javascript\ncli.exec(cmd, callback); //callback receives the output of the process (split into lines)\n```\n\ncli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer)\n\n## Plugins\n\nPlugins are a way of adding common opts and can be enabled using \n\n```javascript\ncli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method\n```\n\n**help** - *enabled by default*\n\nAdds `-h,--help` to output auto-generated usage information\n\n**version**\n\nAdds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json*\n\nTo set your own app name and version, use `cli.setApp(app_name, version)`\n\n**status**\n\nAdds options to show/hide the stylized status messages that are output to the console when using one of these methods\n\n```javascript\ncli.debug(msg); //Only shown when using --debug\ncli.error(msg);\ncli.fatal(msg); //Exits the process after outputting msg\ncli.info(msg);\ncli.ok(msg);\n```\n\n`-k,--no-color` will omit ANSI color escapes from the output\n\n**glob** - *requires* `npm install glob`\n\nEnables glob matching of arguments\n\n**daemon** - *requires* `npm install daemon`\n\nAdds `-d,--daemon ARG` for daemonizing the process and controlling the resulting daemon\n\n`ARG` can be either start (default), stop, restart, pid (outputs the daemon's pid if it's running), or log (output the daemon's stdout+stderr)\n\n**timeout**\n\nAdds `-t,--timeout N` to exit the process after N seconds with an error\n\n**catchall**\n\nAdds `-c,--catch` to catch and output uncaughtExceptions and resume execution\n\n*Note: Plugins are automatically disabled if an option or switch of the same name is already defined*\n\n## LICENSE\n\n(MIT license)\n\nCopyright (c) 2010 Chris O'Hara \n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", 50 | "readmeFilename": "README.md", 51 | "_id": "cli@0.4.5", 52 | "_from": "cli@0.4.x" 53 | } 54 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Isaac Z. Schlueter", 4 | "email": "i@izs.me", 5 | "url": "http://blog.izs.me" 6 | }, 7 | "name": "minimatch", 8 | "description": "a glob matcher in javascript", 9 | "version": "0.2.12", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/isaacs/minimatch.git" 13 | }, 14 | "main": "minimatch.js", 15 | "scripts": { 16 | "test": "tap test" 17 | }, 18 | "engines": { 19 | "node": "*" 20 | }, 21 | "dependencies": { 22 | "lru-cache": "2", 23 | "sigmund": "~1.0.0" 24 | }, 25 | "devDependencies": { 26 | "tap": "" 27 | }, 28 | "license": { 29 | "type": "MIT", 30 | "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" 31 | }, 32 | "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n### Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n", 33 | "readmeFilename": "README.md", 34 | "bugs": { 35 | "url": "https://github.com/isaacs/minimatch/issues" 36 | }, 37 | "_id": "minimatch@0.2.12", 38 | "_from": "minimatch@0.x.x" 39 | } 40 | -------------------------------------------------------------------------------- /Support/node_modules/minimatch/README.md: -------------------------------------------------------------------------------- 1 | # minimatch 2 | 3 | A minimal matching utility. 4 | 5 | [![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) 6 | 7 | 8 | This is the matching library used internally by npm. 9 | 10 | Eventually, it will replace the C binding in node-glob. 11 | 12 | It works by converting glob expressions into JavaScript `RegExp` 13 | objects. 14 | 15 | ## Usage 16 | 17 | ```javascript 18 | var minimatch = require("minimatch") 19 | 20 | minimatch("bar.foo", "*.foo") // true! 21 | minimatch("bar.foo", "*.bar") // false! 22 | ``` 23 | 24 | ## Features 25 | 26 | Supports these glob features: 27 | 28 | * Brace Expansion 29 | * Extended glob matching 30 | * "Globstar" `**` matching 31 | 32 | See: 33 | 34 | * `man sh` 35 | * `man bash` 36 | * `man 3 fnmatch` 37 | * `man 5 gitignore` 38 | 39 | ### Comparisons to other fnmatch/glob implementations 40 | 41 | While strict compliance with the existing standards is a worthwhile 42 | goal, some discrepancies exist between minimatch and other 43 | implementations, and are intentional. 44 | 45 | If the pattern starts with a `!` character, then it is negated. Set the 46 | `nonegate` flag to suppress this behavior, and treat leading `!` 47 | characters normally. This is perhaps relevant if you wish to start the 48 | pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` 49 | characters at the start of a pattern will negate the pattern multiple 50 | times. 51 | 52 | If a pattern starts with `#`, then it is treated as a comment, and 53 | will not match anything. Use `\#` to match a literal `#` at the 54 | start of a line, or set the `nocomment` flag to suppress this behavior. 55 | 56 | The double-star character `**` is supported by default, unless the 57 | `noglobstar` flag is set. This is supported in the manner of bsdglob 58 | and bash 4.1, where `**` only has special significance if it is the only 59 | thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but 60 | `a/**b` will not. **Note that this is different from the way that `**` is 61 | handled by ruby's `Dir` class.** 62 | 63 | If an escaped pattern has no matches, and the `nonull` flag is set, 64 | then minimatch.match returns the pattern as-provided, rather than 65 | interpreting the character escapes. For example, 66 | `minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than 67 | `"*a?"`. This is akin to setting the `nullglob` option in bash, except 68 | that it does not resolve escaped pattern characters. 69 | 70 | If brace expansion is not disabled, then it is performed before any 71 | other interpretation of the glob pattern. Thus, a pattern like 72 | `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded 73 | **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are 74 | checked for validity. Since those two are valid, matching proceeds. 75 | 76 | 77 | ## Minimatch Class 78 | 79 | Create a minimatch object by instanting the `minimatch.Minimatch` class. 80 | 81 | ```javascript 82 | var Minimatch = require("minimatch").Minimatch 83 | var mm = new Minimatch(pattern, options) 84 | ``` 85 | 86 | ### Properties 87 | 88 | * `pattern` The original pattern the minimatch object represents. 89 | * `options` The options supplied to the constructor. 90 | * `set` A 2-dimensional array of regexp or string expressions. 91 | Each row in the 92 | array corresponds to a brace-expanded pattern. Each item in the row 93 | corresponds to a single path-part. For example, the pattern 94 | `{a,b/c}/d` would expand to a set of patterns like: 95 | 96 | [ [ a, d ] 97 | , [ b, c, d ] ] 98 | 99 | If a portion of the pattern doesn't have any "magic" in it 100 | (that is, it's something like `"foo"` rather than `fo*o?`), then it 101 | will be left as a string rather than converted to a regular 102 | expression. 103 | 104 | * `regexp` Created by the `makeRe` method. A single regular expression 105 | expressing the entire pattern. This is useful in cases where you wish 106 | to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. 107 | * `negate` True if the pattern is negated. 108 | * `comment` True if the pattern is a comment. 109 | * `empty` True if the pattern is `""`. 110 | 111 | ### Methods 112 | 113 | * `makeRe` Generate the `regexp` member if necessary, and return it. 114 | Will return `false` if the pattern is invalid. 115 | * `match(fname)` Return true if the filename matches the pattern, or 116 | false otherwise. 117 | * `matchOne(fileArray, patternArray, partial)` Take a `/`-split 118 | filename, and match it against a single row in the `regExpSet`. This 119 | method is mainly for internal use, but is exposed so that it can be 120 | used by a glob-walker that needs to avoid excessive filesystem calls. 121 | 122 | All other methods are internal, and will be called as necessary. 123 | 124 | ## Functions 125 | 126 | The top-level exported function has a `cache` property, which is an LRU 127 | cache set to store 100 items. So, calling these methods repeatedly 128 | with the same pattern and options will use the same Minimatch object, 129 | saving the cost of parsing it multiple times. 130 | 131 | ### minimatch(path, pattern, options) 132 | 133 | Main export. Tests a path against the pattern using the options. 134 | 135 | ```javascript 136 | var isJS = minimatch(file, "*.js", { matchBase: true }) 137 | ``` 138 | 139 | ### minimatch.filter(pattern, options) 140 | 141 | Returns a function that tests its 142 | supplied argument, suitable for use with `Array.filter`. Example: 143 | 144 | ```javascript 145 | var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) 146 | ``` 147 | 148 | ### minimatch.match(list, pattern, options) 149 | 150 | Match against the list of 151 | files, in the style of fnmatch or glob. If nothing is matched, and 152 | options.nonull is set, then return a list containing the pattern itself. 153 | 154 | ```javascript 155 | var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) 156 | ``` 157 | 158 | ### minimatch.makeRe(pattern, options) 159 | 160 | Make a regular expression object from the pattern. 161 | 162 | ## Options 163 | 164 | All options are `false` by default. 165 | 166 | ### debug 167 | 168 | Dump a ton of stuff to stderr. 169 | 170 | ### nobrace 171 | 172 | Do not expand `{a,b}` and `{1..3}` brace sets. 173 | 174 | ### noglobstar 175 | 176 | Disable `**` matching against multiple folder names. 177 | 178 | ### dot 179 | 180 | Allow patterns to match filenames starting with a period, even if 181 | the pattern does not explicitly have a period in that spot. 182 | 183 | Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` 184 | is set. 185 | 186 | ### noext 187 | 188 | Disable "extglob" style patterns like `+(a|b)`. 189 | 190 | ### nocase 191 | 192 | Perform a case-insensitive match. 193 | 194 | ### nonull 195 | 196 | When a match is not found by `minimatch.match`, return a list containing 197 | the pattern itself. When set, an empty list is returned if there are 198 | no matches. 199 | 200 | ### matchBase 201 | 202 | If set, then patterns without slashes will be matched 203 | against the basename of the path if it contains slashes. For example, 204 | `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. 205 | 206 | ### nocomment 207 | 208 | Suppress the behavior of treating `#` at the start of a pattern as a 209 | comment. 210 | 211 | ### nonegate 212 | 213 | Suppress the behavior of treating a leading `!` character as negation. 214 | 215 | ### flipNegate 216 | 217 | Returns from negate expressions the same as if they were not negated. 218 | (Ie, true on a hit, false on a miss.) 219 | -------------------------------------------------------------------------------- /Support/node_modules/shelljs/test/pushd.js: -------------------------------------------------------------------------------- 1 | var shell = require('..'); 2 | 3 | var assert = require('assert'), 4 | path = require('path'), 5 | fs = require('fs'); 6 | 7 | // Node shims for < v0.7 8 | fs.existsSync = fs.existsSync || path.existsSync; 9 | 10 | shell.config.silent = true; 11 | 12 | var root = path.resolve(), trail; 13 | 14 | function reset() { 15 | shell.dirs('-c'); 16 | shell.cd(root); 17 | } 18 | 19 | // Push valid directories 20 | trail = shell.pushd('resources/pushd'); 21 | assert.equal(shell.error(), null); 22 | assert.equal(process.cwd(), trail[0]); 23 | assert.deepEqual(trail, [ 24 | path.resolve(root, 'resources/pushd'), 25 | root 26 | ]); 27 | 28 | trail = shell.pushd('a'); 29 | assert.equal(shell.error(), null); 30 | assert.equal(process.cwd(), trail[0]); 31 | assert.deepEqual(trail, [ 32 | path.resolve(root, 'resources/pushd/a'), 33 | path.resolve(root, 'resources/pushd'), 34 | root 35 | ]); 36 | 37 | trail = shell.pushd('../b'); 38 | assert.equal(shell.error(), null); 39 | assert.equal(process.cwd(), trail[0]); 40 | assert.deepEqual(trail, [ 41 | path.resolve(root, 'resources/pushd/b'), 42 | path.resolve(root, 'resources/pushd/a'), 43 | path.resolve(root, 'resources/pushd'), 44 | root 45 | ]); 46 | 47 | trail = shell.pushd('c'); 48 | assert.equal(shell.error(), null); 49 | assert.equal(process.cwd(), trail[0]); 50 | assert.deepEqual(trail, [ 51 | path.resolve(root, 'resources/pushd/b/c'), 52 | path.resolve(root, 'resources/pushd/b'), 53 | path.resolve(root, 'resources/pushd/a'), 54 | path.resolve(root, 'resources/pushd'), 55 | root 56 | ]); 57 | 58 | // Push stuff around with positive indices 59 | trail = shell.pushd('+0'); 60 | assert.equal(shell.error(), null); 61 | assert.equal(process.cwd(), trail[0]); 62 | assert.deepEqual(trail, [ 63 | path.resolve(root, 'resources/pushd/b/c'), 64 | path.resolve(root, 'resources/pushd/b'), 65 | path.resolve(root, 'resources/pushd/a'), 66 | path.resolve(root, 'resources/pushd'), 67 | root 68 | ]); 69 | 70 | trail = shell.pushd('+1'); 71 | assert.equal(shell.error(), null); 72 | assert.equal(process.cwd(), trail[0]); 73 | assert.deepEqual(trail, [ 74 | path.resolve(root, 'resources/pushd/b'), 75 | path.resolve(root, 'resources/pushd/a'), 76 | path.resolve(root, 'resources/pushd'), 77 | root, 78 | path.resolve(root, 'resources/pushd/b/c') 79 | ]); 80 | 81 | trail = shell.pushd('+2'); 82 | assert.equal(shell.error(), null); 83 | assert.equal(process.cwd(), trail[0]); 84 | assert.deepEqual(trail, [ 85 | path.resolve(root, 'resources/pushd'), 86 | root, 87 | path.resolve(root, 'resources/pushd/b/c'), 88 | path.resolve(root, 'resources/pushd/b'), 89 | path.resolve(root, 'resources/pushd/a') 90 | ]); 91 | 92 | trail = shell.pushd('+3'); 93 | assert.equal(shell.error(), null); 94 | assert.equal(process.cwd(), trail[0]); 95 | assert.deepEqual(trail, [ 96 | path.resolve(root, 'resources/pushd/b'), 97 | path.resolve(root, 'resources/pushd/a'), 98 | path.resolve(root, 'resources/pushd'), 99 | root, 100 | path.resolve(root, 'resources/pushd/b/c') 101 | ]); 102 | 103 | trail = shell.pushd('+4'); 104 | assert.equal(shell.error(), null); 105 | assert.equal(process.cwd(), trail[0]); 106 | assert.deepEqual(trail, [ 107 | path.resolve(root, 'resources/pushd/b/c'), 108 | path.resolve(root, 'resources/pushd/b'), 109 | path.resolve(root, 'resources/pushd/a'), 110 | path.resolve(root, 'resources/pushd'), 111 | root 112 | ]); 113 | 114 | // Push stuff around with negative indices 115 | trail = shell.pushd('-0'); 116 | assert.equal(shell.error(), null); 117 | assert.equal(process.cwd(), trail[0]); 118 | assert.deepEqual(trail, [ 119 | root, 120 | path.resolve(root, 'resources/pushd/b/c'), 121 | path.resolve(root, 'resources/pushd/b'), 122 | path.resolve(root, 'resources/pushd/a'), 123 | path.resolve(root, 'resources/pushd') 124 | ]); 125 | 126 | trail = shell.pushd('-1'); 127 | assert.equal(shell.error(), null); 128 | assert.equal(process.cwd(), trail[0]); 129 | assert.deepEqual(trail, [ 130 | path.resolve(root, 'resources/pushd/a'), 131 | path.resolve(root, 'resources/pushd'), 132 | root, 133 | path.resolve(root, 'resources/pushd/b/c'), 134 | path.resolve(root, 'resources/pushd/b') 135 | ]); 136 | 137 | trail = shell.pushd('-2'); 138 | assert.equal(shell.error(), null); 139 | assert.equal(process.cwd(), trail[0]); 140 | assert.deepEqual(trail, [ 141 | root, 142 | path.resolve(root, 'resources/pushd/b/c'), 143 | path.resolve(root, 'resources/pushd/b'), 144 | path.resolve(root, 'resources/pushd/a'), 145 | path.resolve(root, 'resources/pushd') 146 | ]); 147 | 148 | trail = shell.pushd('-3'); 149 | assert.equal(shell.error(), null); 150 | assert.equal(process.cwd(), trail[0]); 151 | assert.deepEqual(trail, [ 152 | path.resolve(root, 'resources/pushd/b/c'), 153 | path.resolve(root, 'resources/pushd/b'), 154 | path.resolve(root, 'resources/pushd/a'), 155 | path.resolve(root, 'resources/pushd'), 156 | root 157 | ]); 158 | 159 | trail = shell.pushd('-4'); 160 | assert.equal(shell.error(), null); 161 | assert.equal(process.cwd(), trail[0]); 162 | assert.deepEqual(trail, [ 163 | path.resolve(root, 'resources/pushd/b/c'), 164 | path.resolve(root, 'resources/pushd/b'), 165 | path.resolve(root, 'resources/pushd/a'), 166 | path.resolve(root, 'resources/pushd'), 167 | root 168 | ]); 169 | 170 | // Push without changing directory or resolving paths 171 | reset(); trail = shell.pushd('-n', 'resources/pushd'); 172 | assert.equal(shell.error(), null); 173 | assert.equal(process.cwd(), trail[0]); 174 | assert.deepEqual(trail, [ 175 | root, 176 | 'resources/pushd' 177 | ]); 178 | 179 | trail = shell.pushd('-n', 'resources/pushd/a'); 180 | assert.equal(shell.error(), null); 181 | assert.equal(process.cwd(), trail[0]); 182 | assert.deepEqual(trail, [ 183 | root, 184 | 'resources/pushd/a', 185 | 'resources/pushd' 186 | ]); 187 | 188 | // Push invalid directory 189 | shell.pushd('does/not/exist'); 190 | assert.equal(shell.error(), 'pushd: no such file or directory: ' + path.resolve('.', 'does/not/exist') + '\n'); 191 | assert.equal(process.cwd(), trail[0]); 192 | 193 | // Push without arguments should swap top two directories when stack length is 2 194 | reset(); trail = shell.pushd('resources/pushd'); 195 | assert.equal(shell.error(), null); 196 | assert.equal(trail.length, 2); 197 | assert.equal(path.relative(root, trail[0]), 'resources/pushd'); 198 | assert.equal(trail[1], root); 199 | assert.equal(process.cwd(), trail[0]); 200 | trail = shell.pushd(); 201 | assert.equal(shell.error(), null); 202 | assert.equal(trail.length, 2); 203 | assert.equal(trail[0], root); 204 | assert.equal(path.relative(root, trail[1]), 'resources/pushd'); 205 | assert.equal(process.cwd(), trail[0]); 206 | 207 | // Push without arguments should swap top two directories when stack length is > 2 208 | trail = shell.pushd('resources/pushd/a'); 209 | assert.equal(shell.error(), null); 210 | assert.equal(trail.length, 3); 211 | assert.equal(path.relative(root, trail[0]), 'resources/pushd/a'); 212 | assert.equal(trail[1], root); 213 | assert.equal(path.relative(root, trail[2]), 'resources/pushd'); 214 | assert.equal(process.cwd(), trail[0]); 215 | 216 | trail = shell.pushd(); 217 | assert.equal(shell.error(), null); 218 | assert.equal(trail.length, 3); 219 | assert.equal(trail[0], root); 220 | assert.equal(path.relative(root, trail[1]), 'resources/pushd/a'); 221 | assert.equal(path.relative(root, trail[2]), 'resources/pushd'); 222 | assert.equal(process.cwd(), trail[0]); 223 | 224 | // Push without arguments invalid when stack is empty 225 | reset(); shell.pushd(); 226 | assert.equal(shell.error(), 'pushd: no other directory\n'); 227 | 228 | shell.exit(123); -------------------------------------------------------------------------------- /Support/jshint-tm.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var https = require('https'); 3 | var env = process.env || process.ENV; 4 | var jshintPath = __dirname + '/jshint.js'; 5 | var jshintPackagePath = __dirname + '/package.json'; 6 | var exec = require('child_process').exec; 7 | var spawn = require('child_process').spawn; 8 | var child; 9 | var entities = { 10 | '&': '&', 11 | '"': '"', 12 | '<': '<', 13 | '>': '>' 14 | }; 15 | 16 | function html(s) { 17 | return (s || '').replace(/[&"<>]/g, function(c) {return entities[c] || c;}); 18 | } 19 | 20 | /** 21 | * Downloads the latest JSHint from the 2.x branch from GitHub and invokes the callback when done. 22 | * https://raw.github.com/jshint/jshint/2.x/src/jshint.js 23 | */ 24 | function download_jshint_resources(ready) { 25 | var req, 26 | jshint_resources = ["jshint.js", "vars.js", "messages.js", "lex.js", "reg.js", "state.js", "style.js"], 27 | jshint_data_resources = ["ascii-identifier-data.js", "non-ascii-identifier-part-only.js", "non-ascii-identifier-start.js"]; 28 | 29 | jshint_resources.forEach(function(resource) { 30 | req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/2.x/src/' + resource}, function(res) { 31 | if (res.statusCode === 200) { 32 | res.setEncoding('utf8'); 33 | var data = ''; 34 | res.on('data', function(chunk) { 35 | data += chunk; 36 | }); 37 | res.on('end', function() { 38 | fs.writeFile(__dirname + '/' + resource, data, ready); 39 | }); 40 | } 41 | else { 42 | ready('Download of ' + resource + ' failed. HTTP status code: ' + res.statusCode); 43 | } 44 | }).on('error', function(err) { 45 | ready('Download of ' + resource + ' failed: ' + html(err.message)); 46 | }); 47 | }); 48 | jshint_data_resources.forEach(function(resource) { 49 | req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/master/data/' + resource}, function(res) { 50 | if (res.statusCode === 200) { 51 | res.setEncoding('utf8'); 52 | var data = ''; 53 | res.on('data', function(chunk) { 54 | data += chunk; 55 | }); 56 | res.on('end', function() { 57 | fs.writeFile(__dirname + '/../data/' + resource, data, ready); 58 | }); 59 | } 60 | else { 61 | ready('Download of ' + resource + ' failed. HTTP status code: ' + res.statusCode); 62 | } 63 | }).on('error', function(err) { 64 | ready('Download of ' + resource + ' failed: ' + html(err.message)); 65 | }); 66 | }); 67 | } 68 | 69 | /** 70 | * Downloads the latest package.json for JSHint from GitHub and invokes the callback when done. 71 | * https://raw.github.com/jshint/jshint/master/package.json 72 | */ 73 | function download_jshint_package_json(ready) { 74 | var req = https.get({host: 'raw.github.com', port: 443, path: '/jshint/jshint/master/package.json'}, function(res) { 75 | if (res.statusCode === 200) { 76 | res.setEncoding('utf8'); 77 | var data = ''; 78 | res.on('data', function(chunk) { 79 | data += chunk; 80 | }); 81 | res.on('end', function() { 82 | fs.writeFile(jshintPackagePath, data, ready); 83 | }); 84 | } 85 | else { 86 | ready('Download of package.json for jshint.js failed. HTTP status code: ' + res.statusCode); 87 | } 88 | }).on('error', function(err) { 89 | ready('Download of package.json for jshint.js failed: ' + html(err.message)); 90 | }); 91 | } 92 | 93 | /** 94 | * Runs npm install --production for JSHint in Support dir and invokes the callback when done. 95 | * https://raw.github.com/jshint/jshint/master/src/jshint.js 96 | */ 97 | function run_npm_install_for_jshint(ready) { 98 | var install = exec('npm install --production', 99 | { encoding: 'utf8', cwd: __dirname }, 100 | function (error, stdout, stderr) { 101 | if (error) { 102 | ready('npm install of production dependencies for jshint.js failed: ' + stderr); 103 | } else { 104 | ready(); 105 | } 106 | }).on('error', function(err) { 107 | ready('Download of package.json for jshint.js failed: ' + html(err.message)); 108 | }); 109 | } 110 | 111 | function download(callback) { 112 | function done(err) { 113 | callback(err); 114 | } 115 | download_jshint_resources(function (err) { 116 | if (err) { 117 | done(err); 118 | } else { 119 | download_jshint_package_json(function (err) { 120 | if (err) { 121 | done(err); 122 | } else { 123 | run_npm_install_for_jshint(done); 124 | } 125 | }); 126 | } 127 | }); 128 | } 129 | 130 | /** 131 | * Updates the local copy of jshint.js (if it is older than one day) and 132 | * invokes the given callback, passing the JSHINT object. 133 | */ 134 | function autoupdate(callback) { 135 | var fileExists; 136 | function done(err) { 137 | callback(err, (!err || fileExists) && require(jshintPath).JSHINT); 138 | } 139 | // Download jshint.js and update production npm module dependencies 140 | fs.stat(jshintPath, function(err, stats) { 141 | fileExists = !err; 142 | if (err || (Date.now() - Date.parse(stats.mtime)) / 1000 / 60 / 60 / 24 >= 1) { 143 | return download(done); 144 | } 145 | done(); 146 | }); 147 | } 148 | 149 | function closeWindowWithTitle(title) { 150 | spawn('osascript', ['close-window.applescript', title], { cwd: __dirname }); 151 | } 152 | 153 | module.exports = function(options) { 154 | autoupdate(function(err, jshint) { 155 | var file = env.TM_FILEPATH; 156 | var savedFile = fs.readFileSync(file, 'utf8'); 157 | var title = "JSHint: " + env.TM_FILENAME; 158 | var input = ""; 159 | var currentDocument = ""; 160 | var readableStdin = fs.createReadStream('/dev/stdin', { encoding: 'utf8', autoClose: true }); 161 | readableStdin.on('data', function(chunk) { 162 | currentDocument += chunk; 163 | }); 164 | 165 | var body = ''; 166 | if (err) { 167 | body += '
' + err + '
'; 168 | } 169 | if (jshint) { 170 | 171 | readableStdin.on('end', function() { 172 | if (currentDocument.length > 0) { 173 | input = currentDocument; 174 | } else { 175 | input = savedFile; 176 | } 177 | 178 | //remove shebang 179 | input = input.replace(/^\#\!.*/, ''); 180 | 181 | if (!jshint(input, options)) { 182 | jshint.errors.forEach(function(e, i) { 183 | if (e) { 184 | var link = 'txmt://open?url=file://' + escape(file) + '&line=' + e.line + '&column=' + e.character; 185 | body += (''); 186 | if (i < 9) { 187 | body += ''+(i+1)+''; 188 | } 189 | body += e.reason; 190 | if (e.evidence && !isNaN(e.character)) { 191 | body += ''; 192 | body += html(e.evidence.substring(0, e.character-1)); 193 | body += ''; 194 | body += (e.character <= e.evidence.length) ? html(e.evidence.substring(e.character-1, e.character)) : ' '; 195 | body += ''; 196 | body += html(e.evidence.substring(e.character)); 197 | body += ''; 198 | } 199 | body += ''; 200 | } 201 | }); 202 | } 203 | if (body.length > 0) { 204 | fs.readFile(__dirname + '/output.html', 'utf8', function(e, html) { 205 | html = html.replace('{body}', body); 206 | html = html.replace('jshint', "" + title + ""); 207 | console.log(html); 208 | process.exit(205); //show_html 209 | }); 210 | } else { 211 | closeWindowWithTitle(title); 212 | } 213 | }); 214 | } 215 | }); 216 | }; 217 | --------------------------------------------------------------------------------