Skip to content

Commit

Permalink
Merge pull request #89 from minicomp/v1.1.6
Browse files Browse the repository at this point in the history
V1.1.6
  • Loading branch information
mnyrop authored Jul 19, 2023
2 parents 9d78000 + 3221537 commit a875796
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 31 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: ci:test
on:
push:
branches: [main, development, v1*]
pull_request:
paths-ignore:
- '**/README.md'
push:
paths-ignore:
- '**/README.md'
branches: [main, development, v1*]

jobs:
rspec:
Expand All @@ -16,14 +14,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
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.2
3.2.2
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion lib/wax_tasks/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Record
attr_reader :pid, :hash

def initialize(hash)
@hash = hash
@hash = hash.compact
@pid = @hash.dig 'pid'
end

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/wax_tasks/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module WaxTasks
VERSION = '1.1.5'
VERSION = '1.1.6'
end
2 changes: 1 addition & 1 deletion spec/sample_site/_data/valid.csv
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 7 additions & 6 deletions wax_tasks.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ 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'
spec.add_development_dependency 'yard'
end

0 comments on commit a875796

Please sign in to comment.