Skip to content

Instantly share code, notes, and snippets.

@automatthew
automatthew / instant.rake
Created November 10, 2009 20:13
compile and run trivial Java with Rake
# instant.rake
# Rake rules for compiling and running trivial Java programs
#
# Usage: rake com.example.MonkeyShines
# Source goes under ./src
# Classes end up under ./target
require 'rake/clean'
libs = FileList["lib/*"]
class Rack::ProcTitle
F = ::File
PROGNAME = F.basename($0)
def initialize(app)
@app = app
@appname = Dir.pwd.split('/').reverse.
find { |name| name !~ /^(\d+|current|releases)$/ } || PROGNAME
@requests = 0
$0 = "#{PROGNAME} [#{@appname}] init ..."