1
0
Fork 0

No longer using __dirname in requires

I feel like I originally did this because older versions of node didn't like
relative paths (unless maybe the cwd wasn't in NODE_PATH). Regardless, it works
now, and this is cleaner.

Further, I noticed that __dirname didn't seem to be working properly with
browserify. While GNU ease.js does not make use of it (ease.js uses its own
scripts), other projects may.
newmaster
Mike Gerwitz 2014-04-20 21:11:30 -04:00
parent a537721ea1
commit 8391bc007d
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
13 changed files with 30 additions and 30 deletions

View File

@ -24,8 +24,8 @@
* the existing class tests in tact for a higher-level test. * the existing class tests in tact for a higher-level test.
*/ */
var util = require( __dirname + '/util' ), var util = require( './util' ),
warn = require( __dirname + '/warn' ), warn = require( './warn' ),
Warning = warn.Warning, Warning = warn.Warning,
hasOwn = Object.prototype.hasOwnProperty, hasOwn = Object.prototype.hasOwnProperty,

View File

@ -22,7 +22,7 @@
/** /**
* Supertype * Supertype
*/ */
var MemberBuilder = require( __dirname + '/MemberBuilder' ); var MemberBuilder = require( './MemberBuilder' );
/** /**
* Responsible for building class members * Responsible for building class members

View File

@ -41,7 +41,7 @@ module.exports = exports = function FallbackVisibilityObjectFactory()
/** /**
* "Inherit" from VisibilityObjectFactory * "Inherit" from VisibilityObjectFactory
*/ */
exports.prototype = require( __dirname + '/VisibilityObjectFactory' )(); exports.prototype = require( './VisibilityObjectFactory' )();
/** /**

View File

@ -29,8 +29,8 @@
* keywords ]. Decide on a common format. * keywords ]. Decide on a common format.
*/ */
var util = require( __dirname + '/util' ), var util = require( './util' ),
Warning = require( __dirname + '/warn' ).Warning, Warning = require( './warn' ).Warning,
visibility = [ 'public', 'protected', 'private' ] visibility = [ 'public', 'protected', 'private' ]
; ;

View File

@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var AbstractClass = require( __dirname + '/class_abstract' ), var AbstractClass = require( './class_abstract' ),
ClassBuilder = require( __dirname + '/ClassBuilder' ); ClassBuilder = require( './ClassBuilder' );
/** /**

View File

@ -22,7 +22,7 @@
/** /**
* XXX: tightly coupled * XXX: tightly coupled
*/ */
var util = require( __dirname + '/util' ); var util = require( './util' );
/** /**

View File

@ -23,12 +23,12 @@
*/ */
// XXX: Tightly coupled // XXX: Tightly coupled
var util = require( __dirname + '/util' ), var util = require( './util' ),
VisibilityObjectFactory = require( __dirname + '/VisibilityObjectFactory' ), VisibilityObjectFactory = require( './VisibilityObjectFactory' ),
FallbackVisibilityObjectFactory = FallbackVisibilityObjectFactory =
require( __dirname + '/FallbackVisibilityObjectFactory' ) require( './FallbackVisibilityObjectFactory' )
; ;

View File

@ -19,28 +19,28 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var util = require( __dirname + '/util' ), var util = require( './util' ),
ClassBuilder = require( __dirname + '/ClassBuilder' ), ClassBuilder = require( './ClassBuilder' ),
warn = require( __dirname + '/warn' ), warn = require( './warn' ),
Warning = warn.Warning, Warning = warn.Warning,
MethodWrapperFactory = require( __dirname + '/MethodWrapperFactory' ), MethodWrapperFactory = require( './MethodWrapperFactory' ),
wrappers = require( __dirname + '/MethodWrappers' ).standard, wrappers = require( './MethodWrappers' ).standard,
class_builder = ClassBuilder( class_builder = ClassBuilder(
require( __dirname + '/MemberBuilder' )( require( './MemberBuilder' )(
MethodWrapperFactory( wrappers.wrapNew ), MethodWrapperFactory( wrappers.wrapNew ),
MethodWrapperFactory( wrappers.wrapOverride ), MethodWrapperFactory( wrappers.wrapOverride ),
MethodWrapperFactory( wrappers.wrapProxy ), MethodWrapperFactory( wrappers.wrapProxy ),
require( __dirname + '/MemberBuilderValidator' )( require( './MemberBuilderValidator' )(
function( warning ) function( warning )
{ {
warn.handle( Warning( warning ) ); warn.handle( Warning( warning ) );
} }
) )
), ),
require( __dirname + '/VisibilityObjectFactoryFactory' ) require( './VisibilityObjectFactoryFactory' )
.fromEnvironment() .fromEnvironment()
) )
; ;

View File

@ -23,7 +23,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var Class = require( __dirname + '/class' ); var Class = require( './class' );
/** /**

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var Class = require( __dirname + '/class' ); var Class = require( './class' );
/** /**

View File

@ -19,19 +19,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var util = require( __dirname + '/util' ), var util = require( './util' ),
MethodWrapperFactory = require( __dirname + '/MethodWrapperFactory' ), MethodWrapperFactory = require( './MethodWrapperFactory' ),
wrappers = require( __dirname + '/MethodWrappers' ).standard, wrappers = require( './MethodWrappers' ).standard,
member_builder = require( __dirname + '/MemberBuilder' )( member_builder = require( './MemberBuilder' )(
MethodWrapperFactory( wrappers.wrapNew ), MethodWrapperFactory( wrappers.wrapNew ),
MethodWrapperFactory( wrappers.wrapOverride ), MethodWrapperFactory( wrappers.wrapOverride ),
MethodWrapperFactory( wrappers.wrapProxy ), MethodWrapperFactory( wrappers.wrapProxy ),
require( __dirname + '/MemberBuilderValidator' )() require( './MemberBuilderValidator' )()
), ),
Class = require( __dirname + '/class' ) Class = require( './class' )
; ;

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
var propParseKeywords = require( __dirname + '/prop_parser' ).parseKeywords; var propParseKeywords = require( './prop_parser' ).parseKeywords;
/** /**

View File

@ -33,7 +33,7 @@ RMTRAIL="$PATH_TOOLS/rmtrail"
cat_modules=$( cat_modules=$(
cd "$PATH_TOOLS/../" && cd "$PATH_TOOLS/../" &&
grep -rIo ' require(.*)' lib/ \ grep -rIo ' require(.*)' lib/ \
| sed "s/^lib\///;s/\.js://;s/require(.*'\/\(.*\)'.*/\1/" \ | sed "s/^lib\///;s/\.js://;s/require( *'\.\/\(.*\)'.*/\1/" \
| node tools/combine-order.js | node tools/combine-order.js
) || { ) || {
echo "Failed to get module list" >&2 echo "Failed to get module list" >&2