ocr-file 0.0.6 → 0.0.7

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: 9660e3d19c210789a7aeab56e63b002b507c12917edd1418202900d05647773b
4
- data.tar.gz: 28861544f58374db141e5e3cc3ee8569201c4ffd611458e77774c98835e2f882
3
+ metadata.gz: 8b87806d21622a72c6166c35fe4367f5b07135e5e7fab4e8be8b8941f75439dc
4
+ data.tar.gz: d342a91e9b23f8677784553327ba1cc1c00e1599415512b28226f8e9f6bc55b4
5
5
  SHA512:
6
- metadata.gz: 55f4266d6877a7f2c8a4175f5601930c9940aa1a8a06fc1d6d84faca455232173f2ae4be887dc9d20246cb224498a213b91871b66ee3fb3b02699399be33453a
7
- data.tar.gz: e78263baffd1ae1ff1246f705250d788ae6b5c24b3d59d78e169b3ddf93e139ac9b9688cf9d954053a913a1c3bd6be54c40466d372f915c4430d55d93282f1bb
6
+ metadata.gz: ecadeeb21a358274bce4ed3d7fce66e53d31ff3abe940ff1b9d77893f12b73bfd41e9ac35324e3a98f004638f9d1906760ef962a3637fbaf48973faeec9a17cb
7
+ data.tar.gz: 5d4a149dd6d0da1feb723b08c327edab414b75f0b633cea53aaee00d43313d26b84659956957acec7550a822998b76a760b3888770a606d8b4a1f9bb14f807c2
data/README.md CHANGED
@@ -50,9 +50,10 @@ You will need to install `tesseract` with your desired language on your system,
50
50
  extract_pdf_images: true, # if false will screenshot each PDF page
51
51
  temp_filename_prefix: 'image',
52
52
  spelling_correction: true, # Will attempt to fix text at the end (not used for searchable pdf output)
53
+ keep_files: false,
53
54
  # Console Output
54
55
  verbose: true,
55
- timing: true,
56
+ timing: true
56
57
  }
57
58
 
58
59
  doc = OcrFile::Document.new(
@@ -30,9 +30,10 @@ module OcrFile
30
30
  extract_pdf_images: true, # if false will screenshot each PDF page
31
31
  temp_filename_prefix: 'image',
32
32
  spelling_correction: true,
33
+ keep_files: false,
33
34
  # Console Output
34
35
  verbose: true,
35
- timing: true,
36
+ timing: true
36
37
  }
37
38
 
38
39
  attr_reader :original_file_path,
@@ -118,6 +119,7 @@ module OcrFile
118
119
  end
119
120
 
120
121
  def close
122
+ return if keep_files?
121
123
  ::OcrFile::FileHelpers.clear_folder(@temp_folder_path)
122
124
  end
123
125
 
@@ -142,6 +144,10 @@ module OcrFile
142
144
  end
143
145
  end
144
146
 
147
+ def keep_files?
148
+ config['keep_files']
149
+ end
150
+
145
151
  def create_temp_folder
146
152
  date = Time.now.to_s.split(' ').first
147
153
 
@@ -1,3 +1,3 @@
1
1
  module OcrFile
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocr-file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-19 00:00:00.000000000 Z
11
+ date: 2022-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: console-style