Sha256: 05ad5baf13d450aff63fda3f851bac3c3acdd4bba7837d5ac87834914ac02295

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 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'
    CoffeeWithoutNodejs.watch!
  else
    ARGV.each do |file|
      fail "`#{file}' is not valid filename." unless File.exist? file

      if test ?d, file
        Dir.chdir(file) { 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

2 entries across 2 versions & 1 rubygems

Version Path
coffee_without_nodejs-0.4.0 bin/coff
coffee_without_nodejs-0.3.0 bin/coff