Skip to content

Commit 6dfe9d9

Browse files
committed
show the diff too
1 parent 0cb37b4 commit 6dfe9d9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source 'https://rubygems.org'
44
gem 'github-pages', group: :jekyll_plugins
55

66
group :test do
7+
gem 'diffy'
78
gem 'fastimage'
89
gem 'html-proofer'
910
gem 'kwalify'

verify.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'yaml'
22
require 'fastimage'
33
require 'kwalify'
4+
require 'diffy'
45
@output = 0
56

67
# Image max size (in bytes)
@@ -71,10 +72,11 @@ def process_sections_file(path)
7172
end
7273

7374
# Check section alphabetization
74-
if websites != (sites_ordered = websites.sort_by { |s| s['name'].downcase })
75-
error("_data/#{section['id']}.yml not ordered by name. Correct order:")
76-
sites_ordered.each { |site| error(" #{site['name']}\n") }
77-
end
75+
if websites != (sites_sort = websites.sort_by { |s| s['name'].downcase })
76+
error("_data/#{section['id']}.yml not ordered by name. Correct order:" \
77+
"\n" + Diffy::Diff.new(websites.to_yaml, sites_sort.to_yaml, \
78+
context: 10).to_s(:color))
79+
end
7880

7981
# Collect list of all images for section
8082
imgs = Dir["img/#{section['id']}/*"]

0 commit comments

Comments
 (0)