I’m making some modifications to a fork of a gem which I offers the functionality I’m looking for but lacks configuration capabilities I need.

I found that the gem uses Ruby’s autoload mechanism, which I’ve read is a good thing, but the paths it was using messed me up.

This is what I’ve changed to make it work for me:

5,6c4,5
<   self.autoload :LibTidy, File.dirname(__FILE__) + '/tidy_ffi/lib_tidy'
<   self.autoload :Interface, File.dirname(__FILE__) + '/tidy_ffi/interface'
---
>   self.autoload :LibTidy, 'tidy_ffi/lib_tidy'
>   self.autoload :Interface, 'tidy_ffi/interface'
9,11c8,10
< require File.dirname(__FILE__) + '/tidy_ffi/options_container'
< require File.dirname(__FILE__) + '/tidy_ffi/tidy'
< require File.dirname(__FILE__) + '/tidy_ffi/tidy_ffi_extensions'
\ No newline at end of file
---
> require 'tidy_ffi/options_container'
> require 'tidy_ffi/tidy'
> require 'tidy_ffi/tidy_ffi_extensions'
\ No newline at end of file
  • http://www.subelsky.com/2008/05/using-rubys-autoload-method-to.html