Sha256: f4174391d82d2b0f19cc5105febf55017c6f5764aa97d81779e0cff8f4ab589c

Contents?: true

Size: 609 Bytes

Versions: 4

Compression:

Stored size: 609 Bytes

Contents

#!/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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
boojs-0.0.16 bin/boojs
boojs-0.0.15 bin/boojs
boojs-0.0.14 bin/boojs
boojs-0.0.12 bin/boojs