molybdenum-99 / infoboxer

Wikipedia information extraction library
MIT License
174 stars 16 forks source link

Configuration #63

Closed rileyr closed 7 years ago

rileyr commented 8 years ago

In working on #58, I would like to be able to pass in configuration values for Infoboxer. Cache configuration values would be things like strategy and expiration. It seems as though Infoboxer.user_agent= is also a configuration value.

Something like:

Infoboxer.configure do |c|
  c.add_option :user_agent, "my_user_agent"
  c.add_option :cache_strategy, :yaml
  c.add_option :cache_directory, "path/to/my/cache"
  c.add_option :cache_minute_duration, 60 * 24
end

The configuration interface in the attached PR is defined as above.