Permalink
Browse files

New simpler version

  • Loading branch information...
dyoder authored and automatthew committed Oct 22, 2012
1 parent d9f24ac commit 73c0b005d3d8d19d3bea558095a8197128089a78
View
@@ -1,68 +0,0 @@
-# Copyright (c) 2011 Border Stylo
-
-task 'bundle', 'Generate the browser bundle for ax.js', (options)->
- fs = require 'fs'
- path = require 'path'
- browserify = require 'browserify'
- _module = path.join __dirname, 'lib', 'ax.js'
- bundle = path.join __dirname, 'browser', 'ax.js'
- example = path.join __dirname, 'examples', 'javascripts', 'lib', 'ax.js'
-
- src = browserify({ filter : require('uglify-js') })
- .require(_module)
- .bundle()
- ;
-
- buffer = new Buffer [
- 'var Ax = (function () {'
- src
- '; return require("./ax")'
- '})()'
- ].join '';
-
- fs.writeFile bundle, buffer, (err) ->
- throw err if err;
-
- console.log bundle + ' written (' + buffer.length + ' bytes)'
-
- fs.writeFile example, buffer, (err) ->
- throw err if err;
-
- console.log example + ' written (' + buffer.length + ' bytes)'
-
-task 'watch', 'Watch lib/ax.js for auto-bundling', (options)->
- invoke 'bundle'
-
- fs = require 'fs'
- path = require 'path'
- _module = path.join __dirname, 'lib', 'ax.js'
-
- fs.watchFile _module, (current, previous) ->
- if current.mtime > previous.mtime
- invoke 'bundle'
-
-
-option '-p', '--port [PORT]', 'port to run the server on'
-task 'test:server', 'launch a server for the browser tests', (o)->
- browserify = require 'browserify'
- path = require 'path'
- express = require 'express'
- app = express.createServer()
- public_path = path.join __dirname, 'test', 'browser'
- ax = path.join __dirname, 'lib', 'ax'
-
-
- app.configure ->
- app.use express.logger 'dev'
- app.use express.static public_path
-
- app.get '/ax.js', (req, res)->
- res.header 'Content-Type', 'text/javascript'
-
- src = browserify({
- require: ['./lib/ax']
- }).bundle()
-
- res.end(src);
-
- app.listen o.port || 8080
View
@@ -2,39 +2,14 @@
Ax provides a very simple multi-level logging interface.
- var Ax = require("ax");
- var logger = new Ax({level: "debug" });
-
- logger.info("Greetings, Professor Falken.");
- logger.warn("Warning, Will Robinson!");
- logger.error("If I may say so, sir, I noticed earlier the hyperdrive" +
- " motivator has been damaged. It's impossible to go to lightspeed.");
- logger.debug("Instruments register only those things they're designed to" +
- " register. Space still contains infinite unknowns.");
-
-You can also pass a `file` option to log to a file instead of `stdout` and `stderr`.
-
-# License
-
-(The MIT License)
-
-Copyright (c) 2012 Dan Yoder
-Portions Copyright (c) 2011 Border Stylo
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the 'Software'), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+ Ax = require "ax"
+ logger = new Ax level: "debug"
+
+ logger.info "Greetings, Professor Falken"
+ logger.warn "Warning, Will Robinson!"
+ logger.error "If I may say so, sir, I noticed earlier the hyperdrive
+ motivator has been damaged. It's impossible to go to lightspeed."
+ logger.debug "Instruments register only those things they're designed
+ to register. Space still contains infinite unknowns."
+
+You can also pass a `stream` option to log to a stream instead of `stdout`.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
No changes.
Oops, something went wrong.

0 comments on commit 73c0b00

Please sign in to comment.