Sha256: 472e74766ff7510d4004d33a578ba61fc2d1e580b2a61ef4dc2fd470d033b920

Contents?: true

Size: 922 Bytes

Versions: 6

Compression:

Stored size: 922 Bytes

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../lib') # FIXME
require 'rubygems'
require 'coffee-processing'
require 'optparse'

options = {}
op = OptionParser.new do |opts|
  opts.banner =
    "usage: coffee-processing [--template] <js object name> <sketch file>"
  opts.separator ''

  opts.on('--template', 'Create a template page for the sketch') do |v|
    options[:template] = v
  end

  opts.on('-h', '--help', 'Show this message') do
    puts opts
    exit 0
  end
end

op.parse! ARGV

if ARGV.length != 2
  puts op
  exit 1
end

unless File.exists?(ARGV[1])
  puts "#{ARGV[1]} does not exist."
  puts op
  exit 1
end

if options[:template]
  name = File.basename(ARGV[1]).chomp(File.extname(ARGV[1]))
  CoffeeProcessing.generate_template_page ARGV[0], File.read(ARGV[1]), name
  puts "Created #{name} directory."
else
  puts CoffeeProcessing.compile ARGV[0], File.read(ARGV[1])
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coffee-processing-0.0.6 bin/coffee-processing
coffee-processing-0.0.5 bin/coffee-processing
coffee-processing-0.0.4 bin/coffee-processing
coffee-processing-0.0.3 bin/coffee-processing
coffee-processing-0.0.2 bin/coffee-processing
coffee-processing-0.0.1 bin/coffee-processing