#!/usr/bin/env ruby require 'boojs' require 'optparse' require 'phantomjs' #Parse ########################################## parser = OptionParser.new do |opts| opts.banner = "Usage: boojs [-v file] [-e command] [file]" #Verify this file opts.on "-v FILE" do |f| @vfile = f end #One-shot command opts.on "-e COMMAND" do |c| @c = c end end parser.parse! file = ARGV.pop ########################################## #Run verify or run stdin/stdout mode? if @vfile BooJS.verify File.read(@file) else if file BooJS.pipe File.read(file), @c else BooJS.pipe nil, @c end end