Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structure cleanup #185

Merged
merged 2 commits into from
Dec 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion phantomas.js → bin/phantomas.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @see https://github.com/macbre/phantomas
*/
var phantomas = require('./index'),
var phantomas = require('./../lib/index'),
program = require('optimist'),
child,
options = {},
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions index.js → lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var debug = require('debug')('phantomas'),
emitter = require('events').EventEmitter,
spawn = require('child_process').spawn,
phantomjs = require('phantomjs'),
VERSION = require('./package').version;
VERSION = require('./../package').version;

function phantomas(url, options, callback) {
var args = [],
Expand Down Expand Up @@ -35,7 +35,7 @@ function phantomas(url, options, callback) {

// build path to PhantomJS
path = phantomjs.path;
args.push(__dirname + '/scripts/phantomas.js');
args.push(__dirname + '/../scripts/phantomas.js');

// build args
Object.keys(options).forEach(function(key) {
Expand Down Expand Up @@ -103,7 +103,7 @@ function phantomas(url, options, callback) {
}
catch(ex) {
debug('Error when parsing JSON (%s): %s', ex, results);
};
}
}

if (code > 0) {
Expand All @@ -113,7 +113,7 @@ function phantomas(url, options, callback) {
}

if (typeof callback === 'function') {
callback(code == 0 ? null : code, json || results);
callback(code === 0 ? null : code, json || results);
}
});

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.10.1",
"author": "macbre <maciej.brencz@gmail.com> (http://macbre.net)",
"description": "PhantomJS-based web performance metrics collector",
"main": "./index.js",
"main": "./lib/index.js",
"repository": {
"type": "git",
"url": "git://github.com/macbre/phantomas.git"
Expand Down Expand Up @@ -39,11 +39,11 @@
"vows": ">=0.7"
},
"optionalDependencies": {},
"bin": "./phantomas.js",
"bin": "./bin/phantomas.js",
"preferGlobal": true,
"scripts": {
"test": "vows --spec",
"lint": "jshint --verbose core/ modules/ scripts/ test/ lib/*.js phantomas.js run-multiple.js"
"lint": "jshint --verbose core/ modules/ scripts/ test/ lib/*.js run-multiple.js"
},
"jshintConfig": {
"node": true,
Expand Down