Created
February 9, 2011 20:59
-
-
Save eladmeidar/819264 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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