everypolitician / scraped_page_archive

Create an archive of HTML pages scraped by a Ruby scraper
MIT License
1 stars 0 forks source link

Make creating an adapter easier #54

Open chrismytton opened 8 years ago

chrismytton commented 8 years ago

Problem

Creating an adapter, like the existing open-uri and capybara ones, requires a lot of boilerplate code. For example the scraped_page_archive method I added to both adapters in https://github.com/everypolitician/scraped_page_archive/pull/53.

Proposed solution

Add a module that can be included or a class that can be subclassed which has some essential adapter methods. Then the adapters themselves can just focus on glueing the http client to the archive.