Permalink
Browse files

Duckumentation!

  • Loading branch information...
arthurakay committed Dec 7, 2012
1 parent 51c4b0c commit f50fa073b11eaf0f0b392cdf8e386b2293079978
Showing 434 changed files with 7,825 additions and 43 deletions.
View
@@ -33,27 +33,33 @@ var filesystem = require('fs'),
*/
PhantomLint = {
/**
* @property
* @cfg {Array} filepaths
* REQUIRED. An array of relative filepaths to the folders containing JS files
*/
verbose : true,
/**
* @property
* @cfg {Array} exclusions
* REQUIRED. An array of relative filepaths to the folders containing JS files that should NOT be linted
*/
stopOnFirstError : true,
/**
* @property
* @cfg
* True to show verbose ouput in the terminal.
*/
files : [],
verbose : true,
/**
* @property
* @cfg
* True to stop linting your code when the first error is encountered.
*/
exclusions : null,
stopOnFirstError : true,
/**
* @property
* @cfg
* An object containing "file" and "options" properties (False to disable usage.).
*
* - "file" is a relative filepath to the local JSLint file to use (defaults to ./assets/jslint.js).
* - "options" is an object containing the optional lint flags.
*/
jsLint : {
file : 'assets/jslint.js',
@@ -69,7 +75,12 @@ PhantomLint = {
},
/**
* @property
* @cfg
* An object containing "file" and "options" properties (False to disable usage.).
*
* - "file" is a relative filepath to the local JSHint file to use (defaults to ./assets/jshint-master/src/stable/jshint.js).
* - "options" is an object containing the optional lint flags.
*
*/
jsHint : {
file : 'assets/jshint-master/src/stable/jshint.js',
@@ -80,26 +91,14 @@ PhantomLint = {
},
/**
* @property
* @cfg
* A relative filepath to where error messages will be logged.
*/
logFile : 'error_log.txt',
/**
* @private
*/
linters : [],
/**
* @method
* @param {object} config
* @cfg {Array} filepaths An array of relative filepaths to the folders containing JS files
* @cfg {Array} exclusions An array of relative filepaths to the folders containing JS files that should NOT be linted
* @cfg {boolean} verbose false to hide verbose output in your terminal (defaults to true)
* @cfg {string} logFile A relative filepath to where the output error log should go.
* @cfg {boolean} stopOnFirstError false to gather all errors in the file tree (defaults to true)
* @cfg {object/boolean} jsLint An object containing "file" and "options" properties (False to disable usage.). "file" is a relative filepath to the local JSLint file to use (defaults to ./assets/jslint.js). "options" is an object containing the optional lint flags.
* @cfg {object/boolean} jsHint An object containing "file" and "options" properties (False to disable usage.). "file" is a relative filepath to the local JSHint file to use (defaults to ./assets/jshint-master/src/stable/jshint.js). "options" is an object containing the optional lint flags.
* Call this method to de-lint your JavaScript codebase.
*/
init : function (config) {
//APPLY CONFIG OPTIONS
@@ -127,6 +126,21 @@ PhantomLint = {
this.announceSuccess();
},
/**
* @private
*/
files : [],
/**
* @private
*/
linters : [],
/**
* @private
*/
initConfigs : function (config) {
var i;
@@ -157,8 +171,7 @@ PhantomLint = {
},
/**
* @method
* @param {object} config
* @private
*/
applyLintOptions : function (linter, options) {
var i;
@@ -175,7 +188,7 @@ PhantomLint = {
},
/**
* @method
* @private
*/
announceErrors : function (errorList) {
if (typeof this.logFile === 'string') {
@@ -187,16 +200,15 @@ PhantomLint = {
},
/**
* @method
* @private
*/
announceSuccess : function () {
this.log('\nSuccessfully linted yo shit.\n\n', true);
phantom.exit(0);
},
/**
* @method
* @param {string} path
* @private
*/
getFiles : function (path) {
var tree = filesystem.list(path);
@@ -208,9 +220,7 @@ PhantomLint = {
},
/**
* @method
* @param {array} list
* @param {string} path
* @private
*/
parseTree : function (pathConfig) {
var i = 0,
@@ -254,7 +264,7 @@ PhantomLint = {
if (filesystem.isFile(currPath + list[x])) {
this.log(spacer + list[x] + ' IS A FILE');
/**
/*
* We only want JS files
*/
if (regex.test(list[x])) {
@@ -268,7 +278,7 @@ PhantomLint = {
else {
this.log(spacer + list[x] + ' IS NOT A FILE');
/**
/*
* If not a file
* - check against parent paths
* - recurse into child paths
@@ -287,7 +297,7 @@ PhantomLint = {
},
/**
* @method
* @private
*/
lintFiles : function () {
var x = 0,
@@ -319,7 +329,7 @@ PhantomLint = {
},
/**
*
* @private
*/
runJSLint : function (errorList) {
var j = 0,
@@ -365,7 +375,7 @@ PhantomLint = {
},
/**
*
* @private
*/
runJSHint : function (errorList) {
var j = 0,
@@ -411,7 +421,7 @@ PhantomLint = {
},
/**
*
* @private
*/
logToFile : function (errorList) {
this.log('\nWriting ' + (errorList.length / 6) + ' errors to log file.', true);
@@ -428,9 +438,7 @@ PhantomLint = {
},
/**
* @method
* @param {string} msg
* @param {boolean} override
* @private
*/
log : function (msg, override) {
if (this.verbose || override) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Sencha Examples</title>
<script type="text/javascript" src="extjs/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript">
function loadInlineExample(code, options, callback) {
try {
document.body.innerHTML = '';
eval(code);
callback && callback(true);
} catch (e) {
document.body.innerHTML = e;
callback && callback(false, e);
}
}
</script>
</head>
<body>
</body>
</html>
View

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
View