lib/ffi/hunspell/hunspell.rb in ffi-hunspell-0.5.0 vs lib/ffi/hunspell/hunspell.rb in ffi-hunspell-0.6.0

- old
+ new

@@ -26,9 +26,22 @@ attach_function :Hunspell_add, [:pointer, :string], :int attach_function :Hunspell_add_with_affix, [:pointer, :string, :string], :int attach_function :Hunspell_remove, [:pointer, :string], :int attach_function :Hunspell_free_list, [:pointer, :pointer, :int], :void + begin + attach_function :Hunspell_add_dic, [:pointer, :string], :int + rescue FFI::NotFoundError + def self.method_missing(symbol,*arguments,&block) + if symbol == :Hunspell_add_dic + raise NotImplementedError, + "Hunspell_add_dic was not found in [#{ffi_libraries.map(&:name).join(", ")}]. You must install Hunspell 1.3.4 or later if you need this functionality." + end + + super + end + end + # # missing functions: # # attach_function :Hunspell_stem2, [:pointer, :pointer, :pointer, :int], :int # attach_function :Hunspell_generate2, [:pointer, :pointer, :string, :pointer, :int], :int