#!/usr/bin/env jruby require 'rubygems' require 'optparse' require 'rspec' require 'rbconfig' require 'operawatir' require 'operawatir/desktop_helper' @options = { :ng => false, :color_enabled => Config::CONFIG['host_os'] =~ /mswin|mingw|bccwin|wince|emx/ ? false : true, :check_syntax => false, :format => 'progress', :no_quit => false, :no_restart => false } # TODO # Should steal https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/option_parser.rb begin OptionParser.new do |opts| opts.banner = < e abort "desktopwatir: Unknown option `#{e.to_s.sub(/invalid option:\s+/, '')}'" end if ARGV.empty? abort 'desktopwatir: You need to specify at least one test file to run' else @options[:files_to_run] = ARGV @options[:files_to_run].map! { | f | Dir.glob(f) }.flatten! end #abort 'desktopwatir: --ng and --check-syntax are disabled for now' if @options[:ng] || @options[:check_syntax] OperaWatir::DesktopHelper.run! @options