diff --git a/app.js b/app.js index 2bf9b5c..091aa0f 100644 --- a/app.js +++ b/app.js @@ -228,7 +228,7 @@ function require(FN) { } // compile - T = "(function(global){var module=new require.__ModuleObject__();return(function(exports,require,module,__filename,__dirname){" + T = "(function(global){var module=new require.__ModulePrototype__();return(function(exports,require,module,__filename,__dirname){" + '"use strict";' + T + "\n\nreturn module.exports})(module.exports,global.require,module,__filename__,__dirname__)})(require.__global__);\n\n////@ sourceURL=" @@ -256,7 +256,7 @@ function require(FN) { return cache[FN]; } require.__global__ = this; -require.__ModuleObject__ = function() { +require.__ModulePrototype__ = function() { this.exports = {}; }; require.__getDirName__ = function(path) { diff --git a/helloworld.coffee b/helloworld.coffee index a5f4888..3ae8fe2 100644 --- a/helloworld.coffee +++ b/helloworld.coffee @@ -1,3 +1,5 @@ +fortune = require "lib/fortune.coffee" + song = ["do", "re", "mi", "fa", "so"] singers = {Jagger: "Rock", Elvis: "Roll"} @@ -22,5 +24,6 @@ main = (args) -> console.log bitlist.join(',') console.log JSON.stringify(kids) console.log "Hello world, CoffeeScript" + console.log fortune.sayFortune("Foutune!") exports.main = main \ No newline at end of file diff --git a/lib/fortune.coffee b/lib/fortune.coffee new file mode 100644 index 0000000..53acb3e --- /dev/null +++ b/lib/fortune.coffee @@ -0,0 +1,9 @@ +### +Fortune Cookie Reader v1.0 +Released under the MIT License +### + +sayFortune = (fortune) -> + console.log fortune # in bed! + +exports.sayFortune = sayFortune \ No newline at end of file