ssoper / summarize

A Ruby C wrapper for Open Text Summarizer
http://intridea.com/2010/12/3/summarize-a-ruby-c-binding-for-open-text-summarizer
205 stars 14 forks source link

Fix Linux installation, gem build, remove monkey-patch #4

Closed stupied4ever closed 4 years ago

stupied4ever commented 11 years ago

summarize.so was built in ./lib/summarize under Linux machines - the error doesn't occur in OSX. The fix is to create the folder ./lib/summarize, then summarize.so is correctly moved to ./lib/summarize/summarize.so.

As we needed to create the ./lib/summarize folder, we decided to split ./lib/summarize.rb into several files for better organization. Thus, we moved LANGUAGES and VERSION to the new folder.

This commit fixes the cannot load such file -- summarize/summarize error. The error occurs when the gem is built with gem build summarize.gemspec if rake build isn't called. The fix is require 'summarize/version' instead of require 'summarize'.

After all that was done, we fixed the need of monkey-patching std lib, now the user can choose to opt-in the monkey-patching by require 'summarize/core_ext' otherwise he will use Sumarize.summarize('text to be summarized') with the same params as the monkey-patched method.

stupied4ever commented 11 years ago

any review ?