wax_tasks 1.1.2 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d6b199887d4f473d837b2115169191e7ba1761b6402715ef2ef5dc390f0a7e9
4
- data.tar.gz: 3518140ad547ab96d258ce5de5ee9f8bac47dab868409318c7036a89bc85f3fa
3
+ metadata.gz: ba72929e69be8107be29473509f19a93631ca31997152b5d31b197e8482cbbeb
4
+ data.tar.gz: 9bc99826e9a1ebe1a14fe0fbb40ab7e6cbeb8eb941751da26943f1a56d7c3a9e
5
5
  SHA512:
6
- metadata.gz: ba2e755b8068a428edcb8b57ad727bef86108fa5ba6c651ff3191b521e3a71b4d5a2d9a55a8036efa3b27cbae97a03acdacff29fbfc459033af2b287fb018d52
7
- data.tar.gz: 53fe1a0275839addf3b0d98b58ab02982c52885d3d2029a6c2424364b38f17e68ef426bd02449d9900d6dc30ce2f19b9cff577250470fa2ce3edfc9336cec15a
6
+ metadata.gz: f691c56816b236f8ea623c44622c6a90f5ebe7e16dc6811bb2a30a6d807e6bf6b0fff7684a623611479d333ee39822b0e6818b2561580ad81fccd66e32f373ac
7
+ data.tar.gz: a49c2570fcdd2cbc1d0e40058a1da612b6234cfdfaa061b8379beb0631baff0f9d587bb9b19efd765ea7721246bcfa5fb0023923038d7380ef8e126eb9c4136a
@@ -0,0 +1,24 @@
1
+ name: ci:test
2
+ on:
3
+ push:
4
+ branches: [main, development, v1*]
5
+ pull_request:
6
+ branches: [main, development, v1*]
7
+
8
+ jobs:
9
+ rspec:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: change imagemagick policy to allow pdf->png conversion.
13
+ run: |
14
+ sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
15
+ - name: install ghostscript
16
+ run: sudo apt-get update && sudo apt-get install -y ghostscript
17
+ - uses: actions/checkout@v3
18
+ - uses: ruby/setup-ruby@v1
19
+ with:
20
+ bundler-cache: true
21
+ - name: check for outdated gems
22
+ run: bundle outdated
23
+ - name: test
24
+ run: bundle exec rspec
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
2
  NewCops: enable
3
- TargetRubyVersion: 2.4
3
+ TargetRubyVersion: 2.7
4
4
  Exclude: ['spec/**/*', 'test_build/**/*']
5
5
  Layout/LineLength:
6
6
  IgnoredPatterns: ['raise', 'puts', 'set', 'warn', 'ÈÉÊË', 'EEEE', 'safe_join', 'spec']
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/Gemfile CHANGED
@@ -5,7 +5,6 @@ gemspec
5
5
 
6
6
  # dev/test utilities
7
7
  gem 'bundle-audit', require: false
8
- gem 'diane', require: false
9
8
  gem 'rubocop', require: false
10
- gem 'simplecov', '0.17.1', require: false
9
+ gem 'simplecov', require: false
11
10
  gem 'yard', require: false
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # wax_tasks 🐝
2
- [![Build Status](https://travis-ci.com/minicomp/wax_tasks.svg?branch=main)](https://travis-ci.com/minicomp/wax_tasks) [![Depfu](https://badges.depfu.com/badges/6105c55b9634e74b1c27055b19bad8f0/overview.svg)](https://depfu.com/github/minicomp/wax_tasks?project_id=10548)
2
+ [![ci:test](https://github.com/minicomp/wax_tasks/actions/workflows/ci.yml/badge.svg)](https://github.com/minicomp/wax_tasks/actions/workflows/ci.yml) [![Depfu](https://badges.depfu.com/badges/6105c55b9634e74b1c27055b19bad8f0/overview.svg)](https://depfu.com/github/minicomp/wax_tasks?project_id=10548)
3
3
  [![Gem Version](https://badge.fury.io/rb/wax_tasks.svg)](https://badge.fury.io/rb/wax_tasks)
4
4
  [![Gem Downloads](https://img.shields.io/gem/dt/wax_tasks.svg?color=046d0b)](https://badge.fury.io/rb/wax_tasks)
5
5
  [![docs](http://img.shields.io/badge/docs-rdoc.info-blue.svg?style=flat)](https://www.rubydoc.info/github/minicomp/wax_tasks/)
@@ -16,37 +16,38 @@ It can be used to:
16
16
  - generate either IIIF-compliant derivatives ([wax:derivatives:iiif](#waxderivativesiiif)) or simple image derivatives ([wax:derivatives:simple](#waxderivativessimple)) from local image and pdf files
17
17
 
18
18
  <br>
19
- <img src="https://github.com/minicomp/wiki/blob/main/assets/wax_screen.gif?raw=true"/>
19
+ <img src="https://raw.githubusercontent.com/minicomp/wiki/main/src/assets/wax_screen.gif?raw=true?raw=true"/>
20
20
 
21
21
 
22
22
  # Getting Started
23
23
 
24
24
  ## Prerequisites
25
25
 
26
- You'll need `Ruby >= 2.4` with `bundler` installed. Check your versions with:
26
+ You'll need `Ruby >= 3.2` with `bundler` installed. Check your versions with:
27
27
  ```bash
28
28
  $ ruby -v
29
- ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
29
+ ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
30
30
 
31
31
  $ bundler -v
32
- Bundler version 1.16.1
32
+ Bundler version 2.4.16
33
33
  ```
34
34
 
35
35
  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:
36
36
  ```bash
37
37
  $ convert -version
38
- Version: ImageMagick 6.9.9-20 Q16 x86_64 2017-10-15 http://www.imagemagick.org
39
- Copyright: (c) 1999-2017 ImageMagick Studio LLC
40
- License: http://www.imagemagick.org/script/license.php
41
- Features: Cipher DPC Modules
42
- Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
38
+ Version: ImageMagick 7.1.1-12 Q16-HDRI aarch64 21239 https://imagemagick.org
39
+ Copyright: (C) 1999 ImageMagick Studio LLC
40
+ License: https://imagemagick.org/script/license.php
41
+ Features: Cipher DPC HDRI Modules OpenMP(5.0)
42
+ Delegates (built-in): bzlib fontconfig freetype gslib heic jng jp2 jpeg jxl lcms lqr ltdl lzma openexr png ps raw tiff webp xml zlib
43
+ Compiler: gcc (4.2)
43
44
  ```
44
45
 
45
46
  ... and check Ghostscript with:
46
47
  ```bash
47
48
  $ gs -version
48
- GPL Ghostscript 9.21 (2017-03-16)
49
- Copyright (C) 2017 Artifex Software, Inc. All rights reserved.
49
+ GPL Ghostscript 10.01.2 (2023-06-21)
50
+ Copyright (C) 2023 Artifex Software, Inc. All rights reserved.
50
51
  ```
51
52
 
52
53
  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:
@@ -108,7 +109,7 @@ collections:
108
109
  source 'source_images/objects' # path to the directory of source images, must be within '_data'
109
110
 
110
111
  # wax search index settings
111
- lunr_index:
112
+ search:
112
113
  main:
113
114
  index: 'js/lunr-index.json' # where the index will be generated
114
115
  collections: # the collections to index
@@ -4,7 +4,7 @@ require 'wax_tasks'
4
4
 
5
5
  namespace :wax do
6
6
  namespace :derivatives do
7
- desc 'generate iiif derivatives from local image files'
7
+ desc 'generate simple derivatives from local image files'
8
8
  task :simple do
9
9
  args = ARGV.drop(1).each { |a| task a.to_sym }
10
10
  args.reject! { |a| a.start_with? '-' }
@@ -57,7 +57,7 @@ module WaxTasks
57
57
  next if File.exist? path
58
58
 
59
59
  d.img.write path
60
- item.record.set d.label, path if item.record?
60
+ item.record.set d.label, "/#{path}" if item.record?
61
61
  end
62
62
  bar.increment!
63
63
  bar.write
@@ -3,12 +3,15 @@
3
3
  module WaxTasks
4
4
  #
5
5
  class Record
6
- attr_reader :pid, :hash, :order
6
+ attr_reader :pid, :hash
7
7
 
8
8
  def initialize(hash)
9
- @hash = hash
9
+ @hash = hash.compact
10
10
  @pid = @hash.dig 'pid'
11
- @order = @hash.dig 'order'
11
+ end
12
+
13
+ def order
14
+ @hash.dig 'order'
12
15
  end
13
16
 
14
17
  #
@@ -42,7 +45,7 @@ module WaxTasks
42
45
  #
43
46
  #
44
47
  def order?
45
- @order.is_a? String
48
+ !order.to_s.empty?
46
49
  end
47
50
 
48
51
  #
@@ -51,6 +54,12 @@ module WaxTasks
51
54
  @hash.select! { |k, _v| fields.include? k }
52
55
  end
53
56
 
57
+ #
58
+ #
59
+ def drop_empties!
60
+ @hash.reject! { |_k, v| v.nil? || v&.empty? }
61
+ end
62
+
54
63
  #
55
64
  #
56
65
  def write_to_page(dir)
@@ -60,6 +69,7 @@ module WaxTasks
60
69
  if File.exist? path
61
70
  0
62
71
  else
72
+ self.drop_empties!
63
73
  FileUtils.mkdir_p File.dirname(path)
64
74
  File.open(path, 'w') { |f| f.puts "#{@hash.to_yaml}---" }
65
75
  1
@@ -108,7 +108,7 @@ module WaxTasks
108
108
  # Converts string to snake case and swaps out special chars
109
109
  # @return [String]
110
110
  def self.slug(str)
111
- Utils.remove_diacritics(str).to_s.downcase.tr(' ', '_').gsub(/[^\w-]/, '')
111
+ Utils.remove_diacritics(str).to_s.tr(' ', '_').gsub(/[^\w-]/, '')
112
112
  end
113
113
 
114
114
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WaxTasks
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.6'
5
5
  end
data/wax_tasks.gemspec CHANGED
@@ -17,17 +17,18 @@ Gem::Specification.new do |spec|
17
17
  end
18
18
 
19
19
  spec.test_files = Dir['spec/*']
20
- spec.required_ruby_version = '>= 2.4'
20
+ spec.required_ruby_version = '>= 3.0'
21
21
  spec.metadata['yard.run'] = 'yri'
22
22
 
23
23
  spec.requirements << 'imagemagick'
24
24
  spec.requirements << 'ghostscript'
25
25
 
26
- spec.add_runtime_dependency 'progress_bar', '~> 1.3'
27
- spec.add_runtime_dependency 'rainbow', '~> 3.0'
28
- spec.add_runtime_dependency 'rake', '~> 13.0'
29
- spec.add_runtime_dependency 'safe_yaml', '~> 1.0'
26
+ spec.add_runtime_dependency 'progress_bar'
27
+ spec.add_runtime_dependency 'rainbow'
28
+ spec.add_runtime_dependency 'rake'
29
+ spec.add_runtime_dependency 'safe_yaml'
30
30
  spec.add_runtime_dependency 'wax_iiif', '~> 0.2'
31
31
 
32
- spec.add_development_dependency 'rspec', '~> 3'
32
+ spec.add_development_dependency 'rspec'
33
+ spec.add_development_dependency 'yard'
33
34
  end
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wax_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marii Nyrop
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-15 00:00:00.000000000 Z
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: progress_bar
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rainbow
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '13.0'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '13.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: safe_yaml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '1.0'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '1.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: wax_iiif
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +84,30 @@ dependencies:
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '3'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '3'
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Rake tasks for minimal exhibition sites with Minicomp/Wax.
98
112
  email:
99
113
  - marii@nyu.edu
@@ -103,11 +117,11 @@ extra_rdoc_files: []
103
117
  files:
104
118
  - ".github/ISSUE_TEMPLATE/bug_report.md"
105
119
  - ".github/ISSUE_TEMPLATE/feature_request.md"
120
+ - ".github/workflows/ci.yml"
106
121
  - ".gitignore"
107
122
  - ".rspec"
108
123
  - ".rubocop.yml"
109
- - ".travis.yml"
110
- - CHANGELOG.md
124
+ - ".ruby-version"
111
125
  - CODE_OF_CONDUCT.md
112
126
  - Gemfile
113
127
  - LICENSE
@@ -146,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
160
  requirements:
147
161
  - - ">="
148
162
  - !ruby/object:Gem::Version
149
- version: '2.4'
163
+ version: '3.0'
150
164
  required_rubygems_version: !ruby/object:Gem::Requirement
151
165
  requirements:
152
166
  - - ">="
@@ -155,10 +169,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
169
  requirements:
156
170
  - imagemagick
157
171
  - ghostscript
158
- rubygems_version: 3.1.4
172
+ rubygems_version: 3.4.17
159
173
  signing_key:
160
174
  specification_version: 4
161
175
  summary: Rake tasks for minimal exhibition sites with Minicomp/Wax.
162
176
  test_files:
163
- - spec/spec_helper.rb
164
177
  - spec/setup.rb
178
+ - spec/spec_helper.rb
data/.travis.yml DELETED
@@ -1,27 +0,0 @@
1
- # sudo: true
2
- language: ruby
3
- rvm:
4
- - 2.4
5
- - 2.5
6
- - 2.6
7
- addons:
8
- apt:
9
- packages:
10
- - ghostscript
11
- - tree
12
- env:
13
- global:
14
- - CC_TEST_REPORTER_ID=9ef8644063d4113becf719844a0f9c0f8a452f87d69a8315c6fb090123e52cc8
15
- before_install:
16
- - gem update --system
17
- - gem install bundler
18
- - sudo rm /etc/ImageMagick-6/policy.xml
19
- before_script:
20
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
21
- - chmod +x ./cc-test-reporter
22
- - ./cc-test-reporter before-build
23
- script:
24
- - bundle exec bundle-audit
25
- - bundle exec rspec
26
- after_script:
27
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/CHANGELOG.md DELETED
@@ -1,42 +0,0 @@
1
- # Changelog
2
-
3
- Welcome to the Changelog! Below is the first attempt at a log for this project.
4
-
5
- Please note that we define ___breaking changes___ as those changes which force users to change how they interact with __wax_tasks__
6
- via their site's `_config.yml` file or how they invoke the tasks on the command line.
7
-
8
- ## v1.0.3
9
- #### Date: ???
10
-
11
- #### Non-breaking Changes:
12
- - :white_check_mark: Allows use of `wax_iiif < 0.3` (was `<0.2`)
13
- - :white_check_mark: Fix bug where command options (e.g., `--trace`) were being parsed as task ARGV args.
14
-
15
- ## v1.0.2
16
- #### Date: 06/12/2019
17
-
18
- #### Non-breaking Changes:
19
- - :white_check_mark: Fixes [32](https://github.com/minicomp/wax_tasks/issues/32); accepts narrow images (< 1140px)
20
- - :white_check_mark: Fixes [33](https://github.com/minicomp/wax_tasks/issues/33); better image extension handling
21
- - :white_check_mark: Fixes [34](https://github.com/minicomp/wax_tasks/issues/34); ^
22
- - :white_check_mark: Fixes [36](https://github.com/minicomp/wax_tasks/issues/36); fixes bug if an image item doesn't have a record
23
-
24
- ## v1.0.1
25
- #### Date: 06/05/2019
26
-
27
- #### Non-breaking Changes:
28
- - :white_check_mark: Uses `wax_iiif v0.1.2` with better progress bar handling on IIIF derivative generation
29
- - :white_check_mark: Has better progress bar handling on simple derivative generation
30
-
31
- ## v1.0.0
32
- #### Date: 06/04/2019
33
-
34
- #### Breaking Changes:
35
- - :bangbang: __Search index generation__ is now handled under the variable `search` in `_config.yml` instead of `lunr_index` and accepts a hash instead of an array.
36
- - :bangbang: __Search index generation__ is now run with `bundle exec rake wax:search NAME` instead of `bundle exec rake wax:lunr`
37
- - :x: __Search UI__ is now handled dynamically by `wax_theme`; as such the `UI=true` option on the rake task has been depricated.
38
- - :x:: The __site testing__ task `bundle exec rake wax:test` was deprecated and moved to `wax_theme`, since it deals with site presentation and not the handling of collection data.
39
- - :x: The `wax:jspackage` task was depricated, since it was arbitrary and unused.
40
-
41
- #### Non-breaking Changes:
42
- - :white_check_mark: The __page generation__ task `bundle exec rake wax:pagemaster NAME` has become `bundle exec rake wax:pages NAME`. However, this is currently aliased for backwards compatibility.