Permalink
Browse files

stop relying on modified require.paths

  • Loading branch information...
1 parent f77b1b6 commit 677d04aa3e1e2dee4501f1b60f420002e60f12a0 @magnars committed Aug 16, 2011
View
@@ -1,8 +1,6 @@
#!/usr/bin/env node
-require.paths.push(__dirname + '/../lib');
-require.paths.push(__dirname + '/../vendor');
-var loadConfiguration = require('load-configuration');
-var startAutolint = require('start-autolint');
+var loadConfiguration = require('../lib/load-configuration');
+var startAutolint = require('../lib/start-autolint');
loadConfiguration(process.argv.slice(2)).then(startAutolint);
View
@@ -1,4 +1,4 @@
-var pluralize = require('pluralize');
+var pluralize = require('./pluralize');
function validateParams(name, errors) {
if (typeof name !== 'string') {
@@ -1,5 +1,5 @@
-var print = require('print');
-var pluralize = require('pluralize');
+var print = require('./print');
+var pluralize = require('./pluralize');
function create(repository) {
return Object.create(this, {
@@ -1,5 +1,5 @@
var growl = require('growl');
-var pluralize = require('pluralize');
+var pluralize = require('./pluralize');
function create(repository) {
if (!repository) { throw new Error('repository is required'); }
@@ -1,5 +1,5 @@
-var jslintLinter = require('jslint-linter');
+var jslintLinter = require('./jslint-linter');
module.exports = Object.create(jslintLinter, {
- linter: { value: { check: require("jshint").JSHINT } }
+ linter: { value: { check: require("../vendor/jshint").JSHINT } }
});
@@ -1,7 +1,7 @@
var fs = require('fs');
var EventEmitter = require('events').EventEmitter;
var busterPromise = require('buster-promise');
-var checkedFile = require('checked-file');
+var checkedFile = require('./checked-file');
function checkFile(promise, fileName, err, file) {
var errors = this.linter.check(file, this.options) ? [] : this.linter.check.errors;
@@ -20,7 +20,7 @@ function create(options) {
if (!options) { throw new TypeError('options is required (at least an empty object)'); }
return Object.create(this, {
options: { value: options },
- linter: { value: { check: require('jslint').JSLINT } }
+ linter: { value: { check: require('../vendor/jslint').JSLINT } }
});
}
@@ -1,4 +1,4 @@
-var print = require('print');
+var print = require('./print');
function create(repository) {
return Object.create(this, {
View
@@ -1,8 +1,8 @@
var _ = require('underscore');
var glob = require('glob');
-var print = require('print');
var busterPromise = require('buster-promise');
var all = busterPromise.all;
+var print = require('./print');
function fileStartsWith(start) {
return new RegExp("(/|^)" + start + "[^/]+$");
@@ -2,7 +2,7 @@ var busterPromise = require('buster-promise');
var path = require('path');
var fs = require('fs');
var _ = require('underscore');
-var defaultConfig = require('default-configuration');
+var defaultConfig = require('./default-configuration');
function handleError(err) {
if (err) {
@@ -1,4 +1,4 @@
-var print = require('print');
+var print = require('./print');
function create(repository) {
return Object.create(this, {
View
@@ -1,6 +1,6 @@
var sys = require('sys');
var _ = require('underscore');
-var ansi = require('ansi');
+var ansi = require('./ansi');
function putStringWithSys(text) {
sys.puts(text);
View
@@ -1,17 +1,17 @@
-var watchForLint = require('watch-for-lint');
-var onInterrupt = require('on-interrupt');
+var watchForLint = require('./watch-for-lint');
+var onInterrupt = require('./on-interrupt');
module.exports = function (conf) {
- var linter = require(conf.linter + '-linter').create(conf.linterOptions);
+ var linter = require('./' + conf.linter + '-linter').create(conf.linterOptions);
- var lintScanner = require('lint-scanner').create(linter, conf.excludes);
- var repository = require('repository').create(linter);
+ var lintScanner = require('./lint-scanner').create(linter, conf.excludes);
+ var repository = require('./repository').create(linter);
- var newFileReporter = require('new-file-reporter').create(repository);
- var lintReporter = require('lint-reporter').create(repository);
- var cleanReporter = require('clean-reporter').create(repository);
- var summaryReporter = require('summary-reporter').create(repository);
- var growlReporter = require('growl-reporter').create(repository);
+ var newFileReporter = require('./new-file-reporter').create(repository);
+ var lintReporter = require('./lint-reporter').create(repository);
+ var cleanReporter = require('./clean-reporter').create(repository);
+ var summaryReporter = require('./summary-reporter').create(repository);
+ var growlReporter = require('./growl-reporter').create(repository);
repository.listen();
newFileReporter.listen();
@@ -1,5 +1,5 @@
-var _print = require('print');
-var pluralize = require('pluralize');
+var _print = require('./print');
+var pluralize = require('./pluralize');
function create(repository) {
return Object.create(this, {
@@ -1,4 +1,4 @@
-var fileWatcher = require('file-watcher');
+var fileWatcher = require('./file-watcher');
module.exports = function (repository, linter) {
var watcher = Object.create(fileWatcher);
View
@@ -1,8 +1,5 @@
#!/usr/bin/env node
-require.paths.push(__dirname + '/lib');
-require.paths.push(__dirname + '/vendor');
-
var buster = require("buster");
var glob = require("glob");
@@ -1,7 +1,7 @@
var buster = require('buster');
var assert = buster.assert;
-var file = require('checked-file');
+var file = require('../lib/checked-file');
buster.testCase("checkedFile", {
"should be an object": function () {
@@ -1,10 +1,10 @@
var buster = require('buster');
var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
-var print = require('print');
-var checkedFile = require('checked-file');
+var print = require('../lib/print');
+var checkedFile = require('../lib/checked-file');
-var cleanReporter = require('clean-reporter');
+var cleanReporter = require('../lib/clean-reporter');
buster.testCase("cleanReporter", {
setUp: function () {
@@ -2,7 +2,7 @@ var buster = require("buster");
var assert = buster.assert;
var fs = require('fs');
-var fileWatcher = require('file-watcher');
+var fileWatcher = require('../lib/file-watcher');
buster.testCase("fileWatcher", {
setUp: function () {
@@ -3,7 +3,7 @@ var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
var growl = require('growl');
-var growlReporter = require('growl-reporter');
+var growlReporter = require('../lib/growl-reporter');
buster.testCase("growlReporter", {
setUp: function () {
@@ -1,9 +1,9 @@
var buster = require('buster');
var assert = buster.assert;
var fs = require('fs');
-var jslint = require('jslint');
+var jslint = require('../vendor/jslint');
-var linter = require('jslint-linter');
+var linter = require('../lib/jslint-linter');
buster.testCase("jslint-linter", {
setUp: function () {
@@ -1,10 +1,10 @@
var buster = require('buster');
var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
-var print = require('print');
-var checkedFile = require('checked-file');
+var print = require('../lib/print');
+var checkedFile = require('../lib/checked-file');
-var lintReporter = require('lint-reporter');
+var lintReporter = require('../lib/lint-reporter');
buster.testCase("lintReporter", {
setUp: function () {
@@ -2,9 +2,9 @@ var buster = require('buster');
var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
var glob = require('glob');
-var print = require('print');
+var print = require('../lib/print');
-var lintScanner = require('lint-scanner');
+var lintScanner = require('../lib/lint-scanner');
buster.testCase("lintScanner", {
setUp: function () {
@@ -2,9 +2,9 @@ var buster = require('buster');
var assert = buster.assert;
var fs = require('fs');
var path = require('path');
-var defaultConfiguration = require('default-configuration');
+var defaultConfiguration = require('../lib/default-configuration');
-var loadConfiguration = require('load-configuration');
+var loadConfiguration = require('../lib/load-configuration');
buster.testCase("loadConfiguration", {
setUp: function () {
@@ -1,10 +1,10 @@
var buster = require('buster');
var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
-var checkedFile = require('checked-file');
-var print = require('print');
+var checkedFile = require('../lib/checked-file');
+var print = require('../lib/print');
-var newFileReporter = require('new-file-reporter');
+var newFileReporter = require('../lib/new-file-reporter');
buster.testCase("newFileReporter", {
setUp: function () {
@@ -1,7 +1,7 @@
var buster = require('buster');
var assert = buster.assert;
-var pluralize = require('pluralize');
+var pluralize = require('../lib/pluralize');
buster.testCase("pluralize", {
"should not pluralize one item": function () {
View
@@ -1,9 +1,9 @@
var buster = require('buster');
var assert = buster.assert;
var sys = require('sys');
-var ansi = require('ansi');
+var ansi = require('../lib/ansi');
-var print = require('print');
+var print = require('../lib/print');
buster.testCase("print", {
setUp: function () {
@@ -2,9 +2,9 @@ var buster = require('buster');
var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
var glob = require('glob');
-var checkedFile = require('checked-file');
+var checkedFile = require('../lib/checked-file');
-var repository = require('repository');
+var repository = require('../lib/repository');
function file(name, errors) {
return checkedFile.create(name, errors);
@@ -1,10 +1,10 @@
var buster = require('buster');
var assert = buster.assert;
var EventEmitter = require('events').EventEmitter;
-var print = require('print');
-var checkedFile = require('checked-file');
+var print = require('../lib/print');
+var checkedFile = require('../lib/checked-file');
-var summaryReporter = require('summary-reporter');
+var summaryReporter = require('../lib/summary-reporter');
buster.testCase("summaryReporter", {
setUp: function () {
@@ -1,9 +1,9 @@
var buster = require('buster');
var assert = buster.assert;
-var fileWatcher = require('file-watcher');
var EventEmitter = require('events').EventEmitter;
+var fileWatcher = require('../lib/file-watcher');
-var watchForLint = require('watch-for-lint');
+var watchForLint = require('../lib/watch-for-lint');
buster.testCase("watchForLint", {
setUp: function () {

0 comments on commit 677d04a

Please sign in to comment.