Skip to content

Commit

Permalink
Merge pull request #23 from marocchino/ruby-3-support
Browse files Browse the repository at this point in the history
Support ruby 3
  • Loading branch information
spk committed Jan 7, 2021
2 parents d170311 + 7b4464b commit d3366ea
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ test:2.7:
extends: .tests
image: 'ruby:2.7'

test:3.0:
extends: .tests
image: 'ruby:3.0'

test:jruby:
extends: .tests
image: 'jruby:9.2.12-jre'
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rvm:
- 2.5
- 2.6
- 2.7
- 3.0
- jruby-9.2.12.0
- ruby-head
- jruby-head
Expand Down
2 changes: 1 addition & 1 deletion lib/validate_website/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def not_found_error(location)
# @param [Hash] Validator options
#
def validate(doc, body, url, options)
validator = Validator.new(doc, body, options)
validator = Validator.new(doc, body, **options)
if validator.valid?
print color(:success, '.', options[:color]) # rspec style
else
Expand Down
2 changes: 1 addition & 1 deletion lib/validate_website/crawl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/validate_website/static_link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# rubocop:disable Metrics/BlockLength
StaticLink = Struct.new(:link, :site) do
def link_uri
@link_uri = URI.parse(URI.encode(link))
@link_uri = URI.parse(WEBrick::HTTPUtils.escape(link))
@link_uri = URI.join(site, @link_uri) if @link_uri.host.nil?
@link_uri
end
Expand Down
1 change: 1 addition & 0 deletions validate-website.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |s|
s.add_dependency 'spidr', '~> 0.6'
s.add_dependency 'tidy_ffi', '~> 1.0'
s.add_dependency 'w3c_validators', '~> 1.3'
s.add_dependency 'webrick', '~> 1'
s.add_development_dependency 'asciidoctor', '~> 1.5'
s.add_development_dependency 'minitest', '~> 5.0'
s.add_development_dependency 'rake', '~> 12'
Expand Down

0 comments on commit d3366ea

Please sign in to comment.