Sha256: ecf31af2483efbad8fc6faaf1d5bf55f939cf09e1787955a052acb6fc8b9054f

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 Bytes

Contents

require 'rubygems'
require 'activesupport'

module Scraper
  autoload :Article, 'scraper/article'
  autoload :Youtube, 'scraper/youtube'
  autoload :Vimeo,   'scraper/vimeo'
  autoload :Modules, 'scraper/modules'

  HANDLERS = [ :Youtube, :Vimeo, :Article ]
end

def Scraper( args = {} )
  Scraper::HANDLERS.each do |handler| 
    if object = (Scraper.const_get(handler) =~ args)
      return object
    end
  end
  raise ArgumentError, "Scraper cannot handle content from #{args}"
end

$LOAD_PATH.unshift( File.dirname(__FILE__) )

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cyx-scraper-0.3.1 lib/scraper.rb