{"action":"opened","issue":{"url":"https://api.github.com/repos/spk/validate-website/issues/13","labels_url":"https://api.github.com/repos/spk/validate-website/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/spk/validate-website/issues/13/comments","events_url":"https://api.github.com/repos/spk/validate-website/issues/13/events","html_url":"https://github.com/spk/validate-website/issues/13","id":57869213,"number":13,"title":"Crash \"`concat': no implicit conversion of Set into Array (TypeError)\"","user":{"login":"tkrotoff","id":643434,"avatar_url":"https://avatars.githubusercontent.com/u/643434?v=3","gravatar_id":"","url":"https://api.github.com/users/tkrotoff","html_url":"https://github.com/tkrotoff","followers_url":"https://api.github.com/users/tkrotoff/followers","following_url":"https://api.github.com/users/tkrotoff/following{/other_user}","gists_url":"https://api.github.com/users/tkrotoff/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrotoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrotoff/subscriptions","organizations_url":"https://api.github.com/users/tkrotoff/orgs","repos_url":"https://api.github.com/users/tkrotoff/repos","events_url":"https://api.github.com/users/tkrotoff/events{/privacy}","received_events_url":"https://api.github.com/users/tkrotoff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-17T00:39:53Z","updated_at":"2015-02-17T00:39:53Z","closed_at":null,"body":"Full stack trace:\r\n```\r\nbundle exec rake validate-website\r\nvalidating [...]\r\n\r\n./vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:130:in `concat': no implicit conversion of Set into Array (TypeError)\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:130:in `block in check_static_not_found'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:121:in `each'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:121:in `check_static_not_found'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:68:in `block in crawl_static'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:61:in `each'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/core.rb:61:in `crawl_static'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/lib/validate_website/runner.rb:23:in `run_static'\r\n\tfrom /vendor/bundle/ruby/2.0.0/gems/validate-website-1.0.1/bin/validate-website-static:5:in `<top (required)>'\r\n\tfrom /vendor/bundle/ruby/2.0.0/bin/validate-website-static:23:in `load'\r\n\tfrom /vendor/bundle/ruby/2.0.0/bin/validate-website-static:23:in `<main>'\r\n```\r\n\r\nHere my Rakefile (same as the one from your README) for my Jekyll website:\r\n\r\n```Ruby\r\ndesc \"Validate _site with validate-website\"\r\ntask 'validate-website' do\r\n  Dir.chdir('./_site') do\r\n    system(\"bundle exec validate-website-static --site '[...]' --verbose --markup --not-found\") do |ok, res|\r\n      unless ok\r\n        puts \"validate error (status = #{res.exitstatus})\"\r\n      end\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nI order to debug I've added\r\n`p \"extract_urls_from_css(css_page)=#{extract_urls_from_css(css_page).to_a}\"`\r\nto [core.rb](https://github.com/spk/validate-website/blob/v1.0.1/lib/validate_website/core.rb#L130)\r\nIt displays: `\"extract_urls_from_css(css_page)=[nil]\"`.\r\nSo function extract_urls_from_css() has a problem.\r\n\r\nLooking at the [code](https://github.com/spk/validate-website/blob/v1.0.1/lib/validate_website/core.rb#L148), it is missing a declaration: `result = []` and the last statement `result`:\r\n```Ruby\r\ndef extract_urls_from_css(page)\r\n  p \"extract_urls_from_css\"\r\n  result = [] # <===== Declaration\r\n  page.body.scan(/url\\((['\".\\/\\w-]+)\\)/).reduce(Set[]) do |result, url|\r\n    url = url.first.gsub(\"'\", \"\").gsub('\"', '')\r\n    abs = page.to_absolute(URI.parse(url))\r\n    p \"url=#{url}\"\r\n    p \"URI.parse(url)=#{URI.parse(url)}\"\r\n    p \"abs=#{abs}\"\r\n    result << abs\r\n  end\r\n  p \"result=#{result}\"\r\n  result # <===== Last statement\r\nend\r\n```\r\n\r\nIt then works (no more crash) with the following debug infos thx to the puts():\r\n```\r\nbundle exec rake validate-website\r\nvalidating [...]\r\n\r\n.\"extract_urls_from_css\"\r\n\"url=/assets/8-rue-Desnouettes/Cabinet3-header-bg.jpg\"\r\n\"URI.parse(url)=/assets/8-rue-Desnouettes/Cabinet3-header-bg.jpg\"\r\n\"abs=\"\r\n\"result=[]\"\r\n\"extract_urls_from_css(css_page)=[]\"\r\n\"extract_urls_from_css\"\r\n\"url=/assets/8-rue-Desnouettes/Cabinet3-header-bg.jpg\"\r\n\"URI.parse(url)=/assets/8-rue-Desnouettes/Cabinet3-header-bg.jpg\"\r\n\"abs=\"\r\n\"result=[]\"\r\n```\r\n\r\n(I find it strange that my website url (http://....) specified with `--site` is not prepend to /assets/8-rue-Desnouettes/Cabinet3-header-bg.jpg - I have no idea if there is a problem here and how it should work, it is just a feeling).\r\n"}}