File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ source 'https://rubygems.org'
4
4
gem 'github-pages' , group : :jekyll_plugins
5
5
6
6
group :test do
7
+ gem 'diffy'
7
8
gem 'fastimage'
8
9
gem 'html-proofer'
9
10
gem 'kwalify'
Original file line number Diff line number Diff line change 1
1
require 'yaml'
2
2
require 'fastimage'
3
3
require 'kwalify'
4
+ require 'diffy'
4
5
@output = 0
5
6
6
7
# Image max size (in bytes)
@@ -71,10 +72,11 @@ def process_sections_file(path)
71
72
end
72
73
73
74
# 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
78
80
79
81
# Collect list of all images for section
80
82
imgs = Dir [ "img/#{ section [ 'id' ] } /*" ]
You can’t perform that action at this time.
0 commit comments