Sha256: 9bc37dcaa0ae8342aaffbe24e5641d53b6610587d15232fbea3dd8edeba8173b

Contents?: true

Size: 1013 Bytes

Versions: 2

Compression:

Stored size: 1013 Bytes

Contents

#!/usr/bin/env macruby

__DIR__ = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(__DIR__, '..', 'lib')

require 'ichabod'
require 'ichabod/repl'

if STDIN.stat.size > 0
  input = STDIN.read
  puts Ichabod.parse(input)
  exit
end

case ARGV.first
when '-h', '--help'
  puts "Run it:"
  puts " $ ichabod -e '(string to eval)'"
  puts " $ ichabod -p '(string to eval; result will puts)'"
  puts " $ ichabod --jasmine '(http address/path to jasmine tests)'"
  puts " $ ichabod --qunit '(http address/path to qunit tests)'"
  puts " $ ichabod file.js"
  puts " $ ichabod file.html"
  puts " $ ichabod http://example.com"
  puts " $ cat file.html | ichabod"
  puts " $ ichabod"
when '-e'
  Ichabod.eval(ARGV.last)
when '-p'
  puts Ichabod.eval(ARGV.last)
when '--jasmine', '-j'
  puts Ichabod::Tests.jasmine(ARGV.last)
when '--qunit', '-q'
  puts Ichabod::Tests.qunit(ARGV.last)
when nil
  Ichabod::Repl.start
else
  ARGV[-1][/\.js$/] ? Ichabod.eval_file(ARGV.last) : Ichabod.open(ARGV.last)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ichabod-0.0.2 bin/ichabod
ichabod-0.0.1 bin/ichabod