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

Support ruby 3 #23

Merged
merged 2 commits into from Jan 7, 2021
Merged

Support ruby 3 #23

merged 2 commits into from Jan 7, 2021

Conversation

@spk
Copy link
Owner

spk commented Jan 6, 2021

Hey @marocchino, thanks for the update I've started the ci on gitlab (having issues with travis) and some tests are failing i will try to have a look before merging cf https://gitlab.com/spkdev/validate-website/-/jobs/947968716

@spk
Copy link
Owner

spk commented Jan 6, 2021

On the history I've got something strange

#<Set: {#<URI::HTTP http://www.example.com/xhtml1-strict>, #<URI::HTTP http://www.example.com/http%3A%2F%2Ftest.com%2Fimg.png>, #<URI::HTTP http://www.example.com/http%3%2F%2Fwww.example.com%2Fimg1.png>, #<URI::HTTP http://www.example.com/%2Fimg2.png>, #<URI::HTTP http://www.example.com/my-url1>, #<URI::HTTP http://www.example.com/my-url2>}>

You can print crawler.history on crawler.rb and remove the capture_io on the tests; this might be related with the URI encoding change

```
irb(main):001:0> require 'webrick'
=> true
irb(main):002:0> URI.parse(URI.encode_www_form_component("http://example.com/path?query=あああ"))
=> #<URI::Generic http%3A%2F%2Fexample.com%2Fpath%3Fquery%3D%E3%81%82%E3%81%82%E3%81%82>
irb(main):003:0> URI.parse(WEBrick::HTTPUtils.escape("http://example.com/path?query=あああ"))
=> #<URI::HTTP http://example.com/path?query=%E3%81%82%E3%81%82%E3%81%82>
```
@@ -46,7 +46,7 @@ def extract_imgs_from_page(page)

page.doc.search('//img[@src]').reduce(Set[]) do |result, elem|
u = elem.attributes['src'].content
result << page.to_absolute(URI.parse(URI.encode(u)))
result << page.to_absolute(URI.parse(WEBrick::HTTPUtils.escape(u)))
Copy link
Contributor Author

@marocchino marocchino Jan 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

irb(main):001:0> require 'webrick'
=> true
irb(main):002:0> URI.parse(URI.encode_www_form_component("http://example.com/path?query=あああ"))
=> #<URI::Generic http%3A%2F%2Fexample.com%2Fpath%3Fquery%3D%E3%81%82%E3%81%82%E3%81%82>
irb(main):003:0> URI.parse(WEBrick::HTTPUtils.escape("http://example.com/path?query=あああ"))
=> #<URI::HTTP http://example.com/path?query=%E3%81%82%E3%81%82%E3%81%82>

@marocchino
Copy link
Contributor Author

marocchino commented Jan 6, 2021

As a result of running it locally, html5 related errors occur. There is no control group because the same result is given in the master branch(and ruby 2.7.2), but is it a problem with the tidy engine?

# Running:

....FF.............F.........F

Finished in 0.886380s, 33.8455 runs/s, 40.6146 assertions/s.

  1) Failure:
ValidateWebsite::Validator::html5::when not valid::with tidy#test_0002_should exclude errors ignored by :ignore option [/Users/marocchino/Documents/validate-website/test/validator_test.rb:116]:
Expected: 2
  Actual: 116

  2) Failure:
ValidateWebsite::Validator::html5::when not valid::with tidy#test_0001_should have an array of errors [/Users/marocchino/Documents/validate-website/test/validator_test.rb:107]:
Expected: 3
  Actual: 117

  3) Failure:
ValidateWebsite::Static#test_0003_not found [/Users/marocchino/Documents/validate-website/test/static_test.rb:45]:
Expected: 213
  Actual: 210

  4) Failure:
ValidateWebsite::Validator::html5::when valid#test_0001_html5 should be valid [/Users/marocchino/Documents/validate-website/test/validator_test.rb:65]:
Expected: true
  Actual: false

30 runs, 36 assertions, 4 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /Users/marocchino/Documents/validate-website/coverage. 578 / 635 LOC (91.02%) covered.

@spk
Copy link
Owner

spk commented Jan 7, 2021

As a result of running it locally, html5 related errors occur. There is no control group because the same result is given in the master branch(and ruby 2.7.2), but is it a problem with the tidy engine?

Yes you need the tidy-dev, headers packages for this to pass but this look good thanks again

Copy link
Owner

@spk spk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@spk spk merged commit d3366ea into spk:master Jan 7, 2021
@spk
Copy link
Owner

spk commented Jan 7, 2021

Released in https://github.com/spk/validate-website/releases/tag/v1.11.0

@marocchino
Copy link
Contributor Author

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants