Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Additionally:
- Fix new Style/RedundantParentheses offense
- Fix new Style/SuperWithArgsParentheses offenses
- Use Tika 3.1.0
  • Loading branch information
tagliala committed Feb 21, 2025
1 parent 792e027 commit 5b9e1ff
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
options: --entrypoint redis-server

env:
TIKA_VERSION: '3.0.0'
TIKA_VERSION: '3.1.0'

steps:
- name: Install ImageMagick, libmagic-dev, LibreOffice, Tesseract OCR, wkhtmltopdf
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inherit_from: .rubocop_todo.yml

require:
plugins:
- rubocop-performance
- rubocop-rspec

Expand Down
27 changes: 12 additions & 15 deletions .rubocop_todo.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GEM
csv (3.3.2)
daemons (1.4.1)
date (3.4.1)
diff-lcs (1.5.1)
diff-lcs (1.6.0)
docile (1.4.1)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
Expand All @@ -29,7 +29,7 @@ GEM
csv
json (2.7.6)
kgio (2.11.4)
logger (1.6.5)
logger (1.6.6)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
Expand All @@ -38,7 +38,7 @@ GEM
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0107)
mime-types-data (3.2025.0220)
mini_mime (1.1.5)
mini_portile2 (2.8.8)
mustermann (3.0.3)
Expand All @@ -50,15 +50,15 @@ GEM
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-smtp (0.5.1)
net-protocol
netrc (0.11.0)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
raabro (1.4.0)
racc (1.8.1)
rack (2.2.10)
rack (2.2.11)
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
Expand All @@ -78,7 +78,7 @@ GEM
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion docker/colore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get update && apt-get -yq -t bullseye-backports install \
tesseract-ocr-fra \
tesseract-ocr-spa

ARG TIKA_VERSION=3.0.0
ARG TIKA_VERSION=3.1.0

RUN wget --quiet https://archive.apache.org/dist/tika/KEYS -O tika-keys && \
wget --quiet https://archive.apache.org/dist/tika/${TIKA_VERSION}/tika-app-${TIKA_VERSION}.jar.asc -O tika-app.jar.asc && \
Expand Down
20 changes: 10 additions & 10 deletions lib/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,62 @@ class Error < StandardError
attr_accessor :http_code

def initialize(http_code, message)
super message
super(message)
@http_code = http_code
end
end

class InvalidParameter < Error
def initialize(param = nil)
super 400, "Invalid parameter #{param}"
super(400, "Invalid parameter #{param}")
end
end

class DocumentExists < Error
def initialize
super 409, 'A document with this doc_id already exists'
super(409, 'A document with this doc_id already exists')
end
end

class DocumentNotFound < Error
def initialize
super 404, 'Document not found'
super(404, 'Document not found')
end
end

class VersionNotFound < Error
def initialize
super 400, 'Version not found'
super(400, 'Version not found')
end
end

class InvalidVersion < Error
def initialize
super 400, 'Invalid version name'
super(400, 'Invalid version name')
end
end

class VersionIsCurrent < Error
def initialize
super 400, 'Version is current, change current version first'
super(400, 'Version is current, change current version first')
end
end

class InvalidAction < Error
def initialize(message = nil)
super 400, (message || 'Invalid action')
super(400, message || 'Invalid action')
end
end

class FileNotFound < Error
def initialize
super 400, 'Requested file not found'
super(400, 'Requested file not found')
end
end

class ConversionError < Error
def initialize(heathen_error)
super 500, "Conversion error: #{heathen_error.message}"
super(500, "Conversion error: #{heathen_error.message}")
end
end
end
8 changes: 4 additions & 4 deletions lib/heathen/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class Error < StandardError; end
# Raised by task [Processor] method when a pre-condition (such as mime-type) is not valid.
class ExpectationNotMet < Error
def initialize(name, value, pattern)
super "Expectation failure on #{name}, expected '#{value}' to match /#{pattern}/"
super("Expectation failure on #{name}, expected '#{value}' to match /#{pattern}/")
end
end

# Raised by [Converter] if it is unable to find a task to satisfy the requested action.
class TaskNotFound < Error
def initialize(action, mime_type)
super "No task found for action: '#{action}', mime_type: '#{mime_type}'"
super("No task found for action: '#{action}', mime_type: '#{mime_type}'")
end
end

Expand All @@ -27,14 +27,14 @@ class StepError < Error
def initialize(method = nil)
calling_method = caller(3..3).first
method = calling_method.gsub(/.*[`](.*)'$/, '\\1')
super "#{message} in step '#{method}'"
super("#{message} in step '#{method}'")
end
end

# Raised if the task step can't handle the input mime type
class InvalidMimeTypeInStep < StepError
def initialize(expected, got)
super "Invalid mime_type (expected /#{expected}/, got '#{got}')"
super("Invalid mime_type (expected /#{expected}/, got '#{got}')")
end
end

Expand Down

0 comments on commit 5b9e1ff

Please # to comment.