From 1d99db8f23305451a8bdb7b9ee185363ec596eef Mon Sep 17 00:00:00 2001 From: mnyrop Date: Thu, 13 Jul 2023 18:17:12 -0400 Subject: [PATCH 1/8] upgrade to ruby 3.2 --- .ruby-version | 2 +- Gemfile | 1 - wax_tasks.gemspec | 12 ++++++------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.ruby-version b/.ruby-version index 37c2961..be94e6f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.2 +3.2.2 diff --git a/Gemfile b/Gemfile index 43b62f5..a9942f2 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,6 @@ gemspec # dev/test utilities gem 'bundle-audit', require: false -gem 'diane', require: false gem 'rubocop', require: false gem 'simplecov', require: false gem 'yard', require: false diff --git a/wax_tasks.gemspec b/wax_tasks.gemspec index c8311e8..86d33d5 100644 --- a/wax_tasks.gemspec +++ b/wax_tasks.gemspec @@ -17,17 +17,17 @@ Gem::Specification.new do |spec| end spec.test_files = Dir['spec/*'] - spec.required_ruby_version = '>= 2.4' + spec.required_ruby_version = '>= 3.0' spec.metadata['yard.run'] = 'yri' spec.requirements << 'imagemagick' spec.requirements << 'ghostscript' - spec.add_runtime_dependency 'progress_bar', '~> 1.3' - spec.add_runtime_dependency 'rainbow', '~> 3.0' - spec.add_runtime_dependency 'rake', '~> 13.0' - spec.add_runtime_dependency 'safe_yaml', '~> 1.0' + spec.add_runtime_dependency 'progress_bar' + spec.add_runtime_dependency 'rainbow' + spec.add_runtime_dependency 'rake' + spec.add_runtime_dependency 'safe_yaml' spec.add_runtime_dependency 'wax_iiif', '~> 0.2' - spec.add_development_dependency 'rspec', '~> 3' + spec.add_development_dependency 'rspec' end From 950d994fd474bc57da95bb192ecffdba8c68d424 Mon Sep 17 00:00:00 2001 From: mnyrop Date: Thu, 13 Jul 2023 18:21:06 -0400 Subject: [PATCH 2/8] simplify workflow --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 432914c..a8a6b37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,14 +16,10 @@ jobs: sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml - name: install ghostscript run: sudo apt-get update && sudo apt-get install -y ghostscript - - uses: actions/checkout@v2 - with: - fetch-depth: 1 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: install - run: gem install bundler && bundle - name: check for outdated gems run: bundle outdated - name: test From 3a4195df741243fe07ae5bac162d656c4fd832b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marii=C2=A8?= Date: Thu, 13 Jul 2023 18:34:54 -0400 Subject: [PATCH 3/8] run on main & dev --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 432914c..552f73f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,9 @@ name: ci:test on: + push: + branches: [main, development] pull_request: - paths-ignore: - - '**/README.md' - push: - paths-ignore: - - '**/README.md' + branches: [main, development] jobs: rspec: From ba0811bf882c3593e409cd56980430e99f400d21 Mon Sep 17 00:00:00 2001 From: mnyrop Date: Fri, 14 Jul 2023 17:14:56 -0400 Subject: [PATCH 4/8] explicit yard --- wax_tasks.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/wax_tasks.gemspec b/wax_tasks.gemspec index 86d33d5..3903c11 100644 --- a/wax_tasks.gemspec +++ b/wax_tasks.gemspec @@ -30,4 +30,5 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'wax_iiif', '~> 0.2' spec.add_development_dependency 'rspec' + spec.add_development_dependency 'yard' end From 895dd71bdf5f400b2a2143c0b399b0abb1b982e8 Mon Sep 17 00:00:00 2001 From: mnyrop Date: Wed, 19 Jul 2023 14:18:38 -0400 Subject: [PATCH 5/8] update versions in docs --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 43f60b5..b535cb8 100644 --- a/README.md +++ b/README.md @@ -23,30 +23,31 @@ It can be used to: ## Prerequisites -You'll need `Ruby >= 2.4` with `bundler` installed. Check your versions with: +You'll need `Ruby >= 3.2` with `bundler` installed. Check your versions with: ```bash $ ruby -v - ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin18] + ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] $ bundler -v - Bundler version 1.16.1 + Bundler version 2.4.16 ``` To use the image derivative tasks, you will also need to have ImageMagick and Ghostscript installed and functional. You can check to see if you have ImageMagick by running: ```bash $ convert -version - Version: ImageMagick 6.9.9-20 Q16 x86_64 2017-10-15 http://www.imagemagick.org - Copyright: (c) 1999-2017 ImageMagick Studio LLC - License: http://www.imagemagick.org/script/license.php - Features: Cipher DPC Modules - Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib + Version: ImageMagick 7.1.1-12 Q16-HDRI aarch64 21239 https://imagemagick.org + Copyright: (C) 1999 ImageMagick Studio LLC + License: https://imagemagick.org/script/license.php + Features: Cipher DPC HDRI Modules OpenMP(5.0) + Delegates (built-in): bzlib fontconfig freetype gslib heic jng jp2 jpeg jxl lcms lqr ltdl lzma openexr png ps raw tiff webp xml zlib + Compiler: gcc (4.2) ``` ... and check Ghostscript with: ```bash $ gs -version - GPL Ghostscript 9.21 (2017-03-16) - Copyright (C) 2017 Artifex Software, Inc. All rights reserved. + GPL Ghostscript 10.01.2 (2023-06-21) + Copyright (C) 2023 Artifex Software, Inc. All rights reserved. ``` Next, you'll need a Jekyll site. You can clone the [minicomp/wax demo site](https://github.com/minicomp/wax/) or start a site from scratch with: From aae3e98ef829e4c35241b0319b0ced5b587a6689 Mon Sep 17 00:00:00 2001 From: mnyrop Date: Wed, 19 Jul 2023 14:22:06 -0400 Subject: [PATCH 6/8] init v1.1.6 --- lib/wax_tasks/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wax_tasks/version.rb b/lib/wax_tasks/version.rb index ab0e74f..22728a5 100644 --- a/lib/wax_tasks/version.rb +++ b/lib/wax_tasks/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WaxTasks - VERSION = '1.1.5' + VERSION = '1.1.6' end From 2ccc96cf423056e99d1be5adfe01a61d6e003369 Mon Sep 17 00:00:00 2001 From: mnyrop Date: Wed, 19 Jul 2023 14:43:23 -0400 Subject: [PATCH 7/8] drop empty vals from page yml #83 --- lib/wax_tasks/record.rb | 9 ++++++++- spec/sample_site/_data/valid.csv | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/wax_tasks/record.rb b/lib/wax_tasks/record.rb index 47f7964..0675f15 100644 --- a/lib/wax_tasks/record.rb +++ b/lib/wax_tasks/record.rb @@ -6,7 +6,7 @@ class Record attr_reader :pid, :hash def initialize(hash) - @hash = hash + @hash = hash.compact @pid = @hash.dig 'pid' end @@ -54,6 +54,12 @@ def keep_only(fields) @hash.select! { |k, _v| fields.include? k } end + # + # + def drop_empties! + @hash.reject! { |_k, v| v.nil? || v&.empty? } + end + # # def write_to_page(dir) @@ -63,6 +69,7 @@ def write_to_page(dir) if File.exist? path 0 else + self.drop_empties! FileUtils.mkdir_p File.dirname(path) File.open(path, 'w') { |f| f.puts "#{@hash.to_yaml}---" } 1 diff --git a/spec/sample_site/_data/valid.csv b/spec/sample_site/_data/valid.csv index 165fc34..b57052f 100644 --- a/spec/sample_site/_data/valid.csv +++ b/spec/sample_site/_data/valid.csv @@ -1,5 +1,5 @@ "pid","gambrel","indescribable","blasphemous","furtive" -"img_item_1","Geidi Prime","Black as midnight on a moonless night.","Immemorial daemoniac charnel antiquarian nameless.","Miss Darwin Bradtke" +"img_item_1","Geidi Prime","Black as midnight on a moonless night.","Immemorial daemoniac charnel antiquarian nameless.","" "img_item_2","Richesse","Wow, Bob, wow.","Blasphemous loathsome ululate unnamable unutterable lurk cyclopean.","崔泽洋" "dir_imgs_item","null","Pie. Whoever invented the pie? Here was a great person.","Shunned lurk hideous antiquarian foetid furtive antediluvian. Unmentionable accursed gibbous ululate cyclopean. Fainted antiquarian hideous eldritch immemorial unnamable dank singular. Ululate daemoniac madness loathsome cat non-euclidean foetid swarthy. Noisome manuscript cat nameless gibbous.","Mathias Buckridge" "pdf_imgs_item","Ecaz","Cat hideous gibbous madness fungus. Effulgence tenebrous swarthy non-euclidean unutterable.","Iridescence cat stench squamous dank fainted antiquarian unmentionable unnamable.","Lola Narváez Romero" From ca63f01e9fe9c567fb0807a29bef1b7502b15e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marii=C2=A8?= Date: Wed, 19 Jul 2023 14:45:28 -0400 Subject: [PATCH 8/8] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f3023..1dd4b77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: ci:test on: push: - branches: [main, development] + branches: [main, development, v1*] pull_request: - branches: [main, development] + branches: [main, development, v1*] jobs: rspec: