lib/crawlable.rb in crawlable-0.0.1.5 vs lib/crawlable.rb in crawlable-0.0.1.6

- old
+ new

@@ -1,22 +1,20 @@ require 'rubygems' require 'active_support' require 'active_record' +require 'nokogiri' +require 'open-uri' this = File.dirname(__FILE__) -Dir["#{this}/crawlable/*"].each { |c| require c } +Dir["#{this}/crawlable/*"].each { |c| require c if File.extname(c) == ".rb" } -class Settings - include Cockpit::Configuration -end - def Sitemap(*args, &block) - Sitemap.configure(*args, &block) + Crawlable::Sitemap.define!(*args, &block) end -def Crawlable(*args, &block) - Sitemap(*args, &block) +def Feed(*args, &block) + Crawlable::Feed.define!(*args, &block) end -def Crawl(*args, &block) - Sitemap(*args, &block) -end +def Crawlable(type, *args, &block) + type.to_s.constantize(*args, &block) +end \ No newline at end of file