Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Support Fedora systems without libtidy-devel package.

libtidy-devel creates a symlink from libtidy.so to libtidy.so.MAJOR.
  • Loading branch information...
commit fc6b99b835a612b6c96158e0868d4b704f61aa96 1 parent a4c72b0
Eugene Pimenov authored
9 lib/tidy_ffi/lib_tidy.rb
@@ -3,7 +3,14 @@
3 3 # This file must be lazy loaded!
4 4 class TidyFFI::LibTidy #:nodoc:
5 5 extend FFI::Library
6   - ffi_lib TidyFFI.library_path
  6 +
  7 + paths = Array(TidyFFI.library_path || Dir['/{opt,usr}/{,local/}lib{,64}/libtidy.{dylib,so*}'])
  8 + begin
  9 + ffi_lib(*paths)
  10 + rescue LoadError
  11 + raise TidyFFI::LibTidyNotInstalled, "didn't find tidy libs on your system. Please install tidy (http://tidy.sourceforge.net/)"
  12 + end
  13 +
7 14
8 15 attach_function :tidyReleaseDate, [], :string
9 16
11 lib/tidy_ffi/tidy_ffi_extensions.rb
... ... @@ -1,12 +1,5 @@
1 1 module TidyFFI::TidyFFIExtensions #:nodoc:
2   - # Sets path to libtidy.{dylib,so}
3   - def library_path=(path)
4   - @libtidy_path = path
5   - end
6   -
7   - # Returns path to libtidy.{dylib,so}
8   - def library_path
9   - @libtidy_path ||= 'tidy'
10   - end
  2 + # Sets and gets path to libtidy.{dylib,so}
  3 + attr_accessor :library_path
11 4 end
12 5 TidyFFI.extend TidyFFI::TidyFFIExtensions

0 comments on commit fc6b99b

Please sign in to comment.
Something went wrong with that request. Please try again.