README example is outdated
The following code from README documentation does not work anymore:
class QuotesToScrapeCom < Vessel::Cargo
# ...
if next_page = at_xpath("//li[@class='next']/a[@href]")
url = absolute_url(next_page.attribute(:href))
yield request(url: url, handler: :parse)
end
end
end
I copied and pasted the example but I was getting this error:
Traceback (most recent call last):
28: from /usr/local/bundle/bin/irb:23:in `<main>'
27: from /usr/local/bundle/bin/irb:23:in `load'
26: from /usr/local/bundle/gems/irb-1.4.2/exe/irb:11:in `<top (required)>'
9: from (irb):165:in `<main>'
8: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/cargo.rb:19:in `run'
7: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/engine.rb:6:in `run'
6: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/engine.rb:6:in `tap'
5: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/engine.rb:29:in `run'
4: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/engine.rb:40:in `handle'
3: from (irb):108:in `parse'
2: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/cargo.rb:94:in `request'
1: from /usr/local/bundle/gems/vessel-0.2.0/lib/vessel/cargo.rb:94:in `new'
/usr/local/bundle/gems/vessel-0.2.0/lib/vessel/request.rb:13:in `initialize': unknown keyword: :handler (ArgumentError)
After debugging for a while, I noticed that request method cannot be called while passing handler: parameter.
I debugged a little more and noticed that the master code is prepared to accept :handler parameter, but v.0.2.0, which is the version of the gem in my Gemfile is still expecting the :method parameter.
Maybe its time to generate a new release....
What do you think?
I'm in the major update release moment now. I'll do it as soon as I can but like you noticed README is not updated and code is not finished yet.
is there an estimated date for the major update release?
The code is in the master, and it works. But there might be breaking changes, I need to cover everything with tests and I need to write docs. I would expect it in 1-6 months, depending on how fast I go on my spare time.
For the next one, that similarily to me, finds their way here, (https://rubyweekly.com/issues/654 in my case) the current version 0.2.0 README is here (with the matching example) https://github.com/rubycdp/vessel/tree/v0.2.0
And for the others, that are anxious in their chairs and simply want to get the bleeding edge...
gem install specific_install
gem specific_install https://github.com/rubycdp/vessel.git
Good things are worth the wait 😄