Sha256: 33c59735e35f0fd402e26dd759f621f2573c740b1a11d9125f6c2e68fcb9c701

Contents?: true

Size: 846 Bytes

Versions: 1

Compression:

Stored size: 846 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require 'coffee_without_nodejs'

if ARGV.first == '-e'
  ARGV.shift
  content = CoffeeWithoutNodejs.compile(ARGV.first)
  system "echo \"#{content}\" |coderay -js" unless content.empty?
else
  if ARGV.empty?
    `notify-send 'Starting coffee compiler.' -t 1000` if system 'which notify-send &>/dev/null'
    Dir['**/*.coffee'].each {|f| CoffeeWithoutNodejs.compile(f) }
    CoffeeWithoutNodejs.watch!
  else
    ARGV.each do |file|
      fail "`#{file}' is not valid filename." unless File.exist? file

      if test ?d, file
        Dir["#{file}/**/*.coffee"].each {|f| CoffeeWithoutNodejs.compile(f) }
        CoffeeWithoutNodejs.watch!
      else
        js_file = CoffeeWithoutNodejs.compile(file).to_s
        system "coderay -js \"#{js_file}\"" unless js_file.empty?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coffee_without_nodejs-0.1.0 bin/coff