Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README example is outdated #25

Open
gabrielgomes94 opened this issue Nov 9, 2022 · 5 comments
Open

README example is outdated #25

gabrielgomes94 opened this issue Nov 9, 2022 · 5 comments

Comments

@gabrielgomes94
Copy link

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.

@gabrielgomes94
Copy link
Author

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?

@route
Copy link
Member

route commented Nov 10, 2022

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.

@Rajat-Ahuja1997
Copy link

is there an estimated date for the major update release?

@route
Copy link
Member

route commented Dec 7, 2022

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.

@villu164
Copy link

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants