Permalink
Browse files

make FireWatir requirement optional

  • Loading branch information...
scrubber committed May 20, 2009
1 parent 6826117 commit b1bfe0498939d3836cf5c4261d82889cd05ffd68
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/scrubyt.rb
View
@@ -30,11 +30,11 @@
require "#{File.dirname(__FILE__)}/scrubyt/core/navigation/agents/mechanize.rb"
# -- Making Firewatir optional --
- if defined? Firewatir::Firefox
- require "#{File.dirname(__FILE__)}/scrubyt/core/navigation/agents/firewatir.rb"
- else
- puts "The gem firewatir is not installed"
- end
+begin
+ require "#{File.dirname(__FILE__)}/scrubyt/core/navigation/agents/firewatir.rb"
+rescue LoadError
+ puts "The gem firewatir is not installed, you'll be able to use Mechanize as the agent only"
+end
# --
require "#{File.dirname(__FILE__)}/scrubyt/core/navigation/navigation_actions.rb"

0 comments on commit b1bfe04

Please sign in to comment.