Cakefile 537 B

1234567891011121314
  1. fs = require 'fs'
  2. CoffeeScript = require 'coffee-script'
  3. nodeunit = require 'nodeunit'
  4. UglifyJS = require 'uglify-js'
  5. task 'build', 'build javascript files from sources', (cb) ->
  6. source = fs.readFileSync 'src/ipaddr.coffee', 'utf-8'
  7. fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString()
  8. source = fs.readFileSync 'lib/ipaddr.js', 'utf-8'
  9. fs.writeFileSync('ipaddr.min.js', UglifyJS.minify(source).code)
  10. task 'test', 'run the bundled tests', (cb) ->
  11. nodeunit.reporters.default.run ['test']