Rely on rubocop-github for Ruby formatting

This commit is contained in:
Parker Moore
2021-07-15 12:40:38 -04:00
parent dd8bde5e81
commit 3dd804692e
4 changed files with 26 additions and 23 deletions

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'w3c_validators'
require "w3c_validators"
def validator(file)
extension = File.extname(file)
if extension == '.html'
if extension == ".html"
W3CValidators::NuValidator.new
elsif extension == '.css'
elsif extension == ".css"
W3CValidators::CSSValidator.new
end
end
@@ -18,11 +18,11 @@ def validate(file)
path = File.expand_path "../_site/#{file}", __dir__
results = validator(file).validate_file(path)
return puts 'Valid!' if results.errors.empty?
return puts "Valid!" if results.errors.empty?
results.errors.each { |err| puts err.to_s }
exit 1
end
validate 'index.html'
validate File.join 'assets', 'css', 'style.css'
validate "index.html"
validate File.join "assets", "css", "style.css"