From 7b75b88bba4c7585609b5b7b1365351207f9a367 Mon Sep 17 00:00:00 2001 From: Jonathan Zong Date: Fri, 9 Jun 2023 10:22:43 -0400 Subject: [PATCH] update nokogiri dependency (#38) Co-authored-by: Arvind Satyanarayan --- Gemfile | 2 +- Gemfile.lock | 48 ++++++++++++++------------------------- _plugins/MITVisFilters.rb | 12 +++++----- _scripts/tex2md.rb | 6 ++--- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/Gemfile b/Gemfile index 3aa9699..d819bad 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,6 @@ end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] -gem "nokogumbo" +gem "nokogiri", "~> 1.12" gem "webrick" gem "htmlbeautifier" diff --git a/Gemfile.lock b/Gemfile.lock index b914c76..e358d4f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,20 +1,19 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.4) + public_suffix (>= 2.0.2, < 6.0) colorator (1.1.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.2.2) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) ffi (1.15.5) - ffi (1.15.5-x64-mingw-ucrt) forwardable-extended (2.6.0) - htmlbeautifier (1.4.1) + htmlbeautifier (1.4.2) http_parser.rb (0.8.0) - i18n (1.10.0) + i18n (1.13.0) concurrent-ruby (~> 1.0) jekyll (4.2.2) addressable (~> 2.4) @@ -31,7 +30,7 @@ GEM rouge (~> 3.0) safe_yaml (~> 1.0) terminal-table (~> 2.0) - jekyll-feed (0.16.0) + jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) jekyll-sass-converter (2.2.0) sassc (> 2.0.1, < 3.0) @@ -39,60 +38,47 @@ GEM jekyll (>= 3.8, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - kramdown (2.3.1) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) + liquid (4.0.4) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) - nokogiri (1.14.3-arm64-darwin) + nokogiri (1.15.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.3-x64-mingw-ucrt) - racc (~> 1.4) - nokogiri (1.14.3-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.14.3-x86_64-linux) - racc (~> 1.4) - nokogumbo (2.0.5) - nokogiri (~> 1.8, >= 1.8.4) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) + public_suffix (5.0.1) racc (1.6.2) - rb-fsevent (0.11.1) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.5) - rouge (3.28.0) + rouge (3.30.0) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) terminal-table (2.0.0) unicode-display_width (~> 1.1, >= 1.1.1) unicode-display_width (1.8.0) - webrick (1.7.0) + webrick (1.8.1) PLATFORMS - arm64-darwin-21 - x64-mingw-ucrt - x86_64-darwin-19 - x86_64-darwin-20 - x86_64-darwin-21 - x86_64-linux + x86_64-darwin-22 DEPENDENCIES htmlbeautifier jekyll (~> 4.2.0) jekyll-feed (~> 0.12) jekyll-seo-tag - nokogumbo + nokogiri (~> 1.12) tzinfo (~> 1.2) tzinfo-data wdm (~> 0.1.1) webrick BUNDLED WITH - 2.2.22 + 2.4.10 diff --git a/_plugins/MITVisFilters.rb b/_plugins/MITVisFilters.rb index 7d33cfb..1d5ded5 100644 --- a/_plugins/MITVisFilters.rb +++ b/_plugins/MITVisFilters.rb @@ -1,4 +1,4 @@ -require 'nokogumbo' +require 'nokogiri' module MITVisFilters def filter_alumni(input, flag) @@ -6,7 +6,7 @@ def filter_alumni(input, flag) end def filter_titles(arr, titles, flip=false) - arr.select{ |key, value| + arr.select{ |key, value| title = value['title'] first = titles.any? { |t| title.include?(t) } flip ? !first : first @@ -24,7 +24,7 @@ def namesort(arr) if sort_head head = namesort(head) end - + tail = namesort(filter_titles(input, titles, true)) head + tail end @@ -33,12 +33,12 @@ def jsonify_pub(input) people = @context.registers[:site].data['people'] pub = { 'id': input['slug'], - 'title': input['title'], + 'title': input['title'], 'year': input['year'], 'type': input['type'], 'tags': input['tags'].map { |tag| tag.downcase}, - 'authors': input['authors'].map { - |author| author['name'] || people[author['key']]['name'] + 'authors': input['authors'].map { + |author| author['name'] || people[author['key']]['name'] } } diff --git a/_scripts/tex2md.rb b/_scripts/tex2md.rb index 2235b7f..e7609d8 100644 --- a/_scripts/tex2md.rb +++ b/_scripts/tex2md.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby require 'fileutils' -require 'nokogumbo' +require 'nokogiri' require 'htmlbeautifier' # Call from the root directory. @@ -25,7 +25,7 @@ # Improve semantics h6 = doc.css('h6') -h6.each do |h| +h6.each do |h| h.name = 'h2' if h.content == 'Acknowledgements.' h.content = 'Acknowledgements' @@ -91,7 +91,7 @@ # Remove "External Links" text span.inner_html = span.inner_html.sub('External Links: ', '') - + # Remove URL Notes # Remove empty Document links