Skip to content

Instantly share code, notes, and snippets.

@eladmeidar
Created February 9, 2011 20:59
Show Gist options
  • Save eladmeidar/819264 to your computer and use it in GitHub Desktop.
Save eladmeidar/819264 to your computer and use it in GitHub Desktop.
@available_fetchers = Fetcherr.all
if @available_fetchers.empty?
puts "No fetchers found"
else
@available_fetchers.each do |fetcher|
puts "Loading the #{fetcher.name} fetcher"
eval("#{fetcher.name} = Class.new()")
klass = fetcher.name.constantize
klass.class_eval do
include HTTParty
base_uri fetcher.url
@auth = {:username => fetcher.username, :password => fetcher.password}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment