Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | // Generated by CoffeeScript 1.12.7 (function() { var CafRepl, CaffeineMc, CompileCache, Promise, args, cache, colors, commander, compile, compileDirectory, compileFile, compiler, dashCase, displayError, each, escapeRegExp, fileCounts, fileToRun, files, formattedInspect, fs, glob, isString, log, nocache, obj, output, path, present, prettier, realRequire, ref, ref1, ref2, reset, serializer, transpile, verbose, version, versions, slice = [].slice; global.ArtStandardLibMultipleContextTypeSupport = true; colors = require("colors"); glob = require("glob-promise"); fs = require('fs-extra'); path = require('path'); realRequire = eval('require'); ref = CaffeineMc = eval('require')('./index'), version = ref.version, displayError = ref.displayError, CafRepl = ref.CafRepl, CompileCache = ref.CompileCache; ref1 = Neptune.Art.StandardLib, log = ref1.log, dashCase = ref1.dashCase, escapeRegExp = ref1.escapeRegExp, present = ref1.present, isString = ref1.isString, Promise = ref1.Promise, formattedInspect = ref1.formattedInspect, each = ref1.each, escapeRegExp = ref1.escapeRegExp; commander = require("commander").version(version).usage('[options] <input files and directories>').option('-o, --output <directory>', "where to write output files").option('-c, --compile', 'compile files').option('-C, --cache', 'DEPRICATED - cache is on by default').option('--nocache', 'disable compile cache').option('-p, --prettier', 'apply "prettier" to any js output').option('-t, --transpile [presets...]', 'transpile with babel').option('-d, --debug', 'show debug info').option('-v, --verbose', 'show more output').option('-r, --reset', 'reset cache').option('-M, --inlineMap', 'generate source map and include it directly in output').option('--versions [compiler-npm-name]', "show caffeine-mc's version OR the specified caffeine-mc-compatible compiler's version").on("--help", function() { return console.log("An output directory is required if more than one input file is specified.\n\nDefault action, if a file is provided, is to execute it."); }).parse(process.argv); displayError = function(e) { return CaffeineMc.displayError(e, commander); }; reset = commander.reset, output = commander.output, compile = commander.compile, prettier = commander.prettier, transpile = commander.transpile, verbose = commander.verbose, versions = commander.versions, cache = commander.cache, nocache = commander.nocache; cache = !nocache; fileCounts = { read: 0, written: 0, compiled: 0, fromCache: 0 }; compileFile = function(filename, outputDirectory) { return CaffeineMc.compileFile(filename, { outputDirectory: outputDirectory || output || path.dirname(filename), prettier: prettier, transpile: transpile, cache: cache, inlineMap: commander.inlineMap }).then(function(arg) { var output, readCount, writeCount; readCount = arg.readCount, writeCount = arg.writeCount, output = arg.output; if (output.fromCache) { fileCounts.fromCache += readCount; } else { fileCounts.compiled += readCount; } if (verbose) { if (output.fromCache) { log("cached: " + filename.grey); } else { log("compiled: " + filename.green); } } fileCounts.read += readCount; return fileCounts.written += writeCount; }); }; compileDirectory = function(dirname) { return glob(path.join(dirname, "**", "*.caf")).then(function(list) { var serializer; serializer = new Promise.Serializer; each(list, function(filename) { var outputDirectory, relative; relative = path.relative(dirname, filename); if (output) { outputDirectory = path.join(output, path.dirname(relative)); } return serializer.then(function() { return Promise.then(function() { return outputDirectory && fs.ensureDir(outputDirectory); }).then(function() { return compileFile(filename, outputDirectory); }); }); }); return serializer; }); }; if (reset) { CompileCache.reset(); } if (compile) { files = commander.args; if (files.length > 0) { verbose && log({ compile: { inputs: files.length === 1 ? files[0] : files, output: output } }); if (verbose) { log("caffeine-mc loaded"); } if (verbose && (transpile || prettier)) { log({ prettier: prettier, transpile: transpile }); } serializer = new Promise.Serializer; each(files, function(filename) { return serializer.then(function() { if (fs.statSync(filename).isDirectory()) { return compileDirectory(filename); } else { return compileFile(filename); } }); }); serializer.then(function() { if (commander.debug) { log({ DEBUG: { loadedModules: Object.keys(realRequire('module')._cache), registeredLoaders: Object.keys(realRequire.extensions) } }); } return log({ success: { fileCounts: fileCounts } }); }); serializer["catch"](displayError); } else { commander.outputHelp(); } } else if (commander.args.length >= 1) { ref2 = commander.args, fileToRun = ref2[0], args = 2 <= ref2.length ? slice.call(ref2, 1) : []; CaffeineMc.register(); CaffeineMc.runFile(fileToRun, { color: true, cache: cache, verbose: verbose, args: args }); } else if (versions) { if (isString(versions)) { compiler = realRequire(dashCase(versions)); log(( obj = {}, obj["" + versions] = compiler.version || compiler.VERSION, obj )); } log({ Neptune: Neptune.getVersions() }); } else { CafRepl.start(); } }).call(this); |