Skip to content

Commit

Permalink
Handle the case where tidy is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
invernizzi committed Jul 21, 2011
1 parent f967d46 commit 3bfe859
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/relevance/tarantula/tidy_handler.rb
Expand Up @@ -16,7 +16,11 @@
Tidy.path = '/usr/lib/libtidy.so'
rescue LoadError
#I'm a mac
Tidy.path = '/usr/lib/libtidy.dylib'
begin
Tidy.path = '/usr/lib/libtidy.dylib'
rescue LoadError
puts "Tidy library not found, install it"
end
end
end

Expand All @@ -27,6 +31,7 @@ def initialize(options = {})
:char_encoding=>'utf8'}.merge(options)
end
def handle(result)
return unless Tidy.path
response = result.response
return unless response.html?
tidy = Tidy.open(@options) do |tidy|
Expand Down

0 comments on commit 3bfe859

Please sign in to comment.