Make Tidy work on OS X
Kevin Ballard
kevin at sb.org
Wed Sep 7 01:41:46 EDT 2005
Here's a small patch that makes the Tidy detection work under OS X
(where I have a libtidy.dylib rather than libtidy.so):
=== lib/mouseHole.rb
==================================================================
--- lib/mouseHole.rb (revision 24)
+++ lib/mouseHole.rb (revision 26)
@@ -841,8 +841,11 @@
libdirs = ['/usr/lib', '/usr/local/lib'] + $:
libdirs << File.dirname( RUBYSCRIPT2EXE_APPEXE ) if
defined? RUBYSCRIPT2EXE_APPEXE
libdirs.each do |libdir|
- libtidy = File.join( libdir, "libtidy.#{ Config::CONFIG
['arch'] =~ /win32/ ? 'dll' : 'so' }" )
- if File.exists? libtidy
+ libtidies = ['so']
+ libtidies.unshift 'dll' if Config::CONFIG['arch'] =~ /
win32/
+ libtidies.unshift 'dylib' if Config::CONFIG['arch'] =~ /
darwin/
+ libtidies.collect! { |lib| File.join( libdir, "libtidy.#
{lib}") }
+ if libtidy = libtidies.find { |lib| File.exists? lib }
puts "Found Tidy! #{ libtidy }"
require 'tidy'
require 'htree/htmlinfo'
--
Kevin Ballard
kevin at sb.org
http://www.tildesoft.com
http://kevin.sb.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2378 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mousehole-scripters/attachments/20050907/971afee2/smime.bin
More information about the Mousehole-scripters
mailing list