Sha256: 90d7e84b0c193acabc2d0d97d294483649b6fb41016eaa43bf92ecc7b6830158

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'

libdir = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/lib"
$LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)

load "#{libdir}/../rerun.gemspec" # defines "$spec" variable, which we read the version from

require 'optparse'

options = {}

opts = OptionParser.new("", 24, '  ') { |opts|
  opts.banner = "Usage: rerun cmd"

  opts.separator ""
  opts.separator "Launches an app, and restarts it when the filesystem changes."
  opts.separator "See http://github.com/alexch/rerun for more info."
  opts.separator ""
  opts.separator "Options:"

  opts.on("-d dir", "--dir dir", "directory to watch") do |dir|
    options[:dir] = dir
  end

  opts.on_tail("-h", "--help", "--usage", "show this message") do
    puts opts
    exit
  end

  opts.on_tail("--version", "show version") do
    puts $spec.version
    exit
  end

  opts.parse! ARGV
}

#config = ARGV[0] || "config.ru"
#abort "configuration #{config} not found"  unless File.exist? config
#
#if config =~ /\.ru$/ && File.read(config)[/^#\\(.*)/]
#  opts.parse! $1.split(/\s+/)
#end

if ARGV.empty?
  puts opts
  exit
end

require 'rerun'
cmd = ARGV.join(" ")
runner = Rerun::Runner.new(cmd, options)
runner.start
runner.join

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
alexch-rerun-0.3 bin/rerun
dreamcat4-rerun-0.3.1 bin/rerun
dreamcat4-rerun-0.3.2 bin/rerun
rerun-0.4 bin/rerun