#!/usr/bin/env jruby require 'rubygems' require 'optparse' require 'rspec' require 'rbconfig' require 'operawatir' @options = { #:manual => false, :ng => false, :color_enabled => true, :check_syntax => false, :output_stream => IO.new(1, 'w'), :format => 'progress', :no_quit => false, :no_restart => false, :opera_idle => false, #:full_backtrace => false # TODO: Provide fix for RSpec } # 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_or_directories_to_run] = ARGV @options[:files_or_directories_to_run].map! do | f | if f.include? "\\" f else Dir.glob(f) end end.flatten! end require 'operawatir/desktop_helper' OperaWatir::DesktopHelper.run! @options