plaintext 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fde4677879a9d3ce30844e9a5b0439ad2f708f2f532927f96b16d962bd4deb07
4
- data.tar.gz: 900cf36c77f25e98876e9838f2e21a11244f37f059c6c272386fd8102cfd500d
3
+ metadata.gz: 4441c66b3c0738f960ae199f27d86d2b39f3bfdbe700641c7684bfec97873f7e
4
+ data.tar.gz: 65eda38776c07d5b3594bd54caff6d1e774896c853e379aad5249c54976a2853
5
5
  SHA512:
6
- metadata.gz: c744870cc385445ae9a8ad68cfbc5e9489356f23750acdf7a0e8b54ec1ae9c674457c1f14e226aa8aee3bf542ba5fabeac524fda6ad0d89601414c0b77196e5a
7
- data.tar.gz: e6c899c622b42856fd2671b0a7961a938e89389801904d70069b1b1735b8e6e374610f7f2b4d72fd08b16db1f24dcaa994e22b59f9e2a73585206f173b28a234
6
+ metadata.gz: ce83e310d6468c1da82bf1a0d4ecc26a39c056f9ac0b1a10d53b8a2e80e4b54590b9c09085d3c48cfc5cab3ec1389357e99737ad7ca14e268c324115b104cdca
7
+ data.tar.gz: 883e72d6bae46b1bf6be640d1b6c6d9fe43f257db159c3095572c5d2f9c100722e82842b2963a28d9f5f685773696fa44bad72c24d59c101d10fc5550d3fdce0
@@ -0,0 +1,31 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install system dependencies
20
+ run: |
21
+ sudo apt-get update -qq
22
+ sudo apt-get install -y catdoc unrtf poppler-utils tesseract-ocr
23
+
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby-version }}
28
+ bundler-cache: true
29
+
30
+ - name: Run tests
31
+ run: bundle exec rake spec
data/CHANGELOG CHANGED
@@ -4,7 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased]
7
+ ## [0.3.5] - 2025-10-14
8
+
9
+ ### Changed
10
+ - Migrated CI from Travis to GitHub Actions
11
+
12
+ ### Fixed
13
+ - Fix FrozenError when handler returns a frozen string
14
+ - Fix Object#present? not being available in tests by requiring active_support before core_exts
15
+ - Suppress tesseract extra output to reduce noise in OCR results
8
16
 
9
17
  ## [0.3.4] - 2021-04-21
10
18
  - Further relax the rubyzip version requirement to allow 2.x versions
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # plaintext [![Build Status](https://travis-ci.org/planio-gmbh/plaintext.svg?branch=master)](https://travis-ci.org/planio-gmbh/plaintext)
1
+ # plaintext [![Test](https://github.com/planio-gmbh/plaintext/actions/workflows/test.yml/badge.svg)](https://github.com/planio-gmbh/plaintext/actions/workflows/test.yml)
2
2
 
3
3
  This gem wraps command line tools to extract plain text from typical files such as
4
4
 
@@ -8,7 +8,7 @@ module Plaintext
8
8
  'image/tiff'
9
9
  ]
10
10
  DEFAULT = [
11
- '/usr/bin/tesseract', '__FILE__', 'stdout'
11
+ '/usr/bin/tesseract', '__FILE__', 'stdout', 'quiet'
12
12
  ].freeze
13
13
  def initialize
14
14
  @content_types = CONTENT_TYPES
@@ -36,7 +36,7 @@ module Plaintext
36
36
  # for the file type.
37
37
  def text
38
38
  if handler = find_handler and
39
- text = handler.text(@file, max_size: max_plaintext_bytes)
39
+ text = +handler.text(@file, max_size: max_plaintext_bytes)
40
40
 
41
41
  text.gsub!(/\s+/m, ' ')
42
42
  text.strip!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Plaintext
4
- VERSION = "0.3.4"
4
+ VERSION = "0.3.5"
5
5
  end
data/lib/plaintext.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'active_support'
4
+ require 'active_support/core_ext/object/blank'
3
5
  require 'active_support/core_ext/string'
4
6
 
5
7
  require 'plaintext/version'
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plaintext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Krämer
8
8
  - Planio GmbH
9
9
  - OpenProject GmbH
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-04-21 00:00:00.000000000 Z
13
+ date: 2025-10-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -110,9 +110,9 @@ executables: []
110
110
  extensions: []
111
111
  extra_rdoc_files: []
112
112
  files:
113
+ - ".github/workflows/test.yml"
113
114
  - ".gitignore"
114
115
  - ".rspec"
115
- - ".travis.yml"
116
116
  - CHANGELOG
117
117
  - Gemfile
118
118
  - LICENSE
@@ -146,7 +146,7 @@ homepage: https://github.com/planio-gmbh/plaintext
146
146
  licenses:
147
147
  - GPL-2.0
148
148
  metadata: {}
149
- post_install_message:
149
+ post_install_message:
150
150
  rdoc_options: []
151
151
  require_paths:
152
152
  - lib
@@ -161,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
- rubygems_version: 3.0.3
165
- signing_key:
164
+ rubygems_version: 3.1.6
165
+ signing_key:
166
166
  specification_version: 4
167
167
  summary: Extract plain text from most common office documents.
168
168
  test_files: []
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.6.4
4
- before_install:
5
- - sudo apt-get -qq update
6
- - sudo apt-get install -y catdoc unrtf poppler-utils tesseract-ocr
7
- - gem install bundler -v 2.0.1