Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added option for growl notifications at start/end.

  • Loading branch information...
commit 8428cffe01aca6648ded327d350417dc0a458bd1 1 parent 5addd0d
@doches authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 tools/test.rb
View
17 tools/test.rb
@@ -5,6 +5,7 @@
options = OpenStruct.new
options.format=:auto
+options.growl=false
optparser = OptionParser.new do |opts|
opts.banner = "Usage: ./test.rb path/to/input.xml [options]"
opts.banner = <<USE
@@ -24,6 +25,16 @@
" file extension as XML, and all other input as TREEBANK") do |format|
options.format = format
end
+
+ opts.on("--growl","-g","Enable Growl notifications (using ruby-growl)") do
+ begin
+ require 'lib/ruby-growl'
+ @growl = Growl.new("127.0.0.1","FDL",["begin","end"])
+ options.growl = true
+ rescue
+ STDERR.puts("Unable to load ruby-growl, continuing without growl notifications")
+ end
+ end
opts.on_tail("-h","--help","Show this help text") do
puts opts
@@ -73,6 +84,9 @@
end
end
+# Send a [begin] notification, if enabled
+@growl.notify("begin","Featurising","Starting FDL featurisation") if options.growl
+
# Get features
feature_file = ARGV[0]
require "#{feature_file}"
@@ -91,3 +105,6 @@
}
}
}
+
+# Send a [end] notification, if enabled
+@growl.notify("end","Done featurising","Finished FDL featurisation") if options.growl
Please sign in to comment.
Something went wrong with that request. Please try again.