Sha256: 6144a7027fd423ab4d63af62b4459666051320b0a8d7d143510899bea41fc01e

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby
#
#  Created on 2008-5-11.
#  Copyright (c) 2008. All rights reserved.

begin
  require 'rubygems'
rescue LoadError
  # no rubygems to load, so we fail silently
end

require 'optparse'
require 'ftools'

# NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.

OPTIONS = {
  :path     => '~'
}
MANDATORY_OPTIONS = %w(  )

parser = OptionParser.new do |opts|
  opts.banner = <<BANNER
This application is wonderful because...

Usage: #{File.basename($0)} [options]

Options are:
BANNER
  opts.separator ""
  opts.on("-p", "--path=PATH", String,
          "The root path for selecting files",
          "Default: ~") { |OPTIONS[:path]| }
  opts.on("-h", "--help",
          "Show this help message.") { puts opts; exit }
  opts.parse!(ARGV)

  if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
    puts opts; exit
  end
end

path = OPTIONS[:path]

f = File.new(File.expand_path(path) + "/.autotest",  "w")
f.write "# ~.autotest\n"
f.write "require 'autotest_notification'"
f.close
puts "\nAs from now all tests will be notified automatically.\n"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
carlosbrando-autotest-notification-0.0.7 bin/an-install