Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

troubleshooting command to verify libtidy is installed #8

Open
jesperronn opened this issue Dec 18, 2017 · 3 comments
Open

troubleshooting command to verify libtidy is installed #8

jesperronn opened this issue Dec 18, 2017 · 3 comments

Comments

@jesperronn
Copy link

Hi, first of all, thanks for maintaining this project

I am looking for a very simple command to verify a system where I want to ensure html tidy is installed before I start doing fancy stuff and cleaning.

For other libraries, usually I would run lib --version.

But the only thing I could find here was this:

TidyFFI::LibTidy.tidyReleaseDate
=> "31 October 2006 - Apple Inc. build 15.18.1"

This works... but I would rather prefer a version call or something. From https://github.com/libc/tidy_ffi/blob/master/lib/tidy_ffi/lib_tidy.rb#L18 I see that there is a tidyRelease as well, but it takes a parameter.

In your opinion, what would be the best ping or troubleshooting command I could use?

@libc
Copy link
Owner

libc commented Dec 19, 2017

This gem is a wrapper of the library. http://api.html-tidy.org/tidy/tidylib_api_5.6.0/group__Basic.html

tidyRelease is to clear memory associated with the document see this

I think you're looking for tidyLibraryVersion. I think it wasn't available in the past, that's why I haven't used it.

I will do more research about the version when it appeared.

@jesperronn
Copy link
Author

Thanks for your response. Is there a way we could enhance this library to expose that version from the underlying library. I tried TidyFFI::LibTidy.tidyLibraryVersion but it gave me an error:

TidyFFI::LibTidy.tidyLibraryVersion
NoMethodError: undefined method `tidyLibraryVersion' for TidyFFI::LibTidy:Class

how exactly could I use tidyLibraryVersion?

@spk
Copy link
Contributor

spk commented Mar 9, 2019

Hi, I'm using this snippet from this project to verify tidy is installed on the system:

def tidy
  return @tidy if defined?(@tidy)
  @lib_tidy = TidyFFI::LibTidy
  @tidy = TidyFFI::Tidy
rescue TidyFFI::LibTidyNotInstalled
  @tidy = nil
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants