public
Rubygem
Description: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
Homepage: http://www.nomedojogo.com/
Clone URL: git://github.com/carlosbrando/autotest-notification.git
autotest-notification / bin / an-uninstall
100644 50 lines (40 sloc) 1.156 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/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]
 
autotest_file = File.expand_path(path) + "/.autotest"
if File.exist?(autotest_file)
  File.delete(autotest_file)
  puts "\nYou no longer receive notifications of your tests."
  puts "" # a blank line
end