pdfh 0.1.8 → 0.1.9
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 +4 -4
- data/.gitignore +37 -12
- data/.rubocop.yml +16 -2
- data/.rubocop_todo.yml +133 -3
- data/.ruby-version +1 -1
- data/CHANGELOG.md +3 -0
- data/Gemfile +14 -3
- data/Gemfile.lock +52 -36
- data/README.md +9 -0
- data/Rakefile +6 -6
- data/bin/console +6 -6
- data/exe/pdfh +18 -8
- data/lib/ext/string.rb +1 -1
- data/lib/pdfh.rb +17 -17
- data/lib/pdfh/document.rb +24 -24
- data/lib/pdfh/pdf_handler.rb +1 -1
- data/lib/pdfh/settings.rb +7 -7
- data/lib/pdfh/utils.rb +2 -2
- data/lib/pdfh/version.rb +1 -1
- data/pdfh.gemspec +22 -31
- metadata +3 -117
- data/.travis.yml +0 -7
- data/docs/legacy.md +0 -453
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14832944087c61f4949fe3fd42cdb848ebfd8a8931826cbd3e4fc111f5813a31
|
4
|
+
data.tar.gz: 16c139cc38b766307fe4fe9a21b740161af8fffcc05b5c8397cfdde843b1b943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0c320fcead6ae5e09a37ba17100837d392017b73fa0cd54b5d4126bebc52bd07f009457af741128df8197c67fb52d82eee2422a16b6240930f9e72ff795a950
|
7
|
+
data.tar.gz: 335af04d4f5753d39e4464be53a24986f89dff1cc1e9fa2866e8340680317337cf3b24eb043cdbcdef5051fa47d45dcfe67ab685b289173dc42e789d5014e3c6
|
data/.gitignore
CHANGED
@@ -1,15 +1,40 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
/
|
4
|
-
/
|
5
|
-
/
|
6
|
-
/
|
7
|
-
/
|
8
|
-
/tmp/
|
9
|
-
|
10
|
-
.DS_Store
|
1
|
+
.yardoc/
|
2
|
+
_yardoc/
|
3
|
+
coverage/
|
4
|
+
pkg/
|
5
|
+
spec/reports/
|
6
|
+
spec/coverage/
|
7
|
+
tmp/
|
11
8
|
|
12
9
|
# rspec failure tracking
|
13
10
|
.rspec_status
|
14
|
-
|
15
|
-
|
11
|
+
|
12
|
+
### macOS
|
13
|
+
# General
|
14
|
+
.DS_Store
|
15
|
+
.AppleDouble
|
16
|
+
.LSOverride
|
17
|
+
|
18
|
+
# Icon must end with two \r
|
19
|
+
Icon
|
20
|
+
|
21
|
+
|
22
|
+
# Thumbnails
|
23
|
+
._*
|
24
|
+
|
25
|
+
# Files that might appear in the root of a volume
|
26
|
+
.DocumentRevisions-V100
|
27
|
+
.fseventsd
|
28
|
+
.Spotlight-V100
|
29
|
+
.TemporaryItems
|
30
|
+
.Trashes
|
31
|
+
.VolumeIcon.icns
|
32
|
+
.com.apple.timemachine.donotpresent
|
33
|
+
|
34
|
+
# Directories potentially created on remote AFP share
|
35
|
+
.AppleDB
|
36
|
+
.AppleDesktop
|
37
|
+
Network Trash Folder
|
38
|
+
Temporary Items
|
39
|
+
.apdisk
|
40
|
+
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,25 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
+
require:
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-rake
|
6
|
+
- rubocop-rspec
|
7
|
+
|
3
8
|
AllCops:
|
4
9
|
NewCops: enable
|
5
10
|
TargetRubyVersion: 2.5
|
6
11
|
Exclude:
|
7
|
-
-
|
8
|
-
-
|
12
|
+
- pkg/**/*
|
13
|
+
- tmp/**/*
|
9
14
|
|
15
|
+
Layout/LineLength:
|
16
|
+
Max: 120
|
17
|
+
IgnoredPatterns: ['^\s*#']
|
10
18
|
|
19
|
+
Style/StringLiterals:
|
20
|
+
Enabled: true
|
21
|
+
EnforcedStyle: double_quotes
|
11
22
|
|
23
|
+
Style/StringLiteralsInInterpolation:
|
24
|
+
Enabled: true
|
25
|
+
EnforcedStyle: double_quotes
|
data/.rubocop_todo.yml
CHANGED
@@ -1,22 +1,152 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2021-03-02 12:13:30 UTC using RuboCop version 1.11.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 1
|
10
|
-
# Configuration parameters: IgnoredMethods.
|
10
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
11
11
|
Metrics/AbcSize:
|
12
12
|
Max: 23
|
13
13
|
|
14
|
+
# Offense count: 4
|
15
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
16
|
+
# IgnoredMethods: refine
|
17
|
+
Metrics/BlockLength:
|
18
|
+
Max: 144
|
19
|
+
|
14
20
|
# Offense count: 1
|
15
21
|
# Configuration parameters: CountComments, CountAsOne.
|
16
22
|
Metrics/ClassLength:
|
17
23
|
Max: 149
|
18
24
|
|
19
25
|
# Offense count: 5
|
20
|
-
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
|
26
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
21
27
|
Metrics/MethodLength:
|
22
28
|
Max: 13
|
29
|
+
|
30
|
+
# Offense count: 2
|
31
|
+
RSpec/AnyInstance:
|
32
|
+
Exclude:
|
33
|
+
- 'spec/pdfh_spec.rb'
|
34
|
+
|
35
|
+
# Offense count: 13
|
36
|
+
# Cop supports --auto-correct.
|
37
|
+
RSpec/ContextMethod:
|
38
|
+
Exclude:
|
39
|
+
- 'spec/classes/document_spec.rb'
|
40
|
+
- 'spec/classes/month_spec.rb'
|
41
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
42
|
+
- 'spec/classes/settings_spec.rb'
|
43
|
+
- 'spec/pdfh_spec.rb'
|
44
|
+
|
45
|
+
# Offense count: 13
|
46
|
+
# Configuration parameters: Prefixes.
|
47
|
+
# Prefixes: when, with, without
|
48
|
+
RSpec/ContextWording:
|
49
|
+
Exclude:
|
50
|
+
- 'spec/classes/document_spec.rb'
|
51
|
+
- 'spec/classes/month_spec.rb'
|
52
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
53
|
+
- 'spec/classes/settings_spec.rb'
|
54
|
+
- 'spec/pdfh_spec.rb'
|
55
|
+
|
56
|
+
# Offense count: 1
|
57
|
+
# Cop supports --auto-correct.
|
58
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
59
|
+
# SupportedStyles: described_class, explicit
|
60
|
+
RSpec/DescribedClass:
|
61
|
+
Exclude:
|
62
|
+
- 'spec/classes/settings_spec.rb'
|
63
|
+
|
64
|
+
# Offense count: 16
|
65
|
+
# Cop supports --auto-correct.
|
66
|
+
# Configuration parameters: AllowConsecutiveOneLiners.
|
67
|
+
RSpec/EmptyLineAfterExample:
|
68
|
+
Exclude:
|
69
|
+
- 'spec/classes/document_spec.rb'
|
70
|
+
- 'spec/classes/dry_spec.rb'
|
71
|
+
- 'spec/classes/month_spec.rb'
|
72
|
+
- 'spec/classes/settings_spec.rb'
|
73
|
+
- 'spec/classes/verbose_spec.rb'
|
74
|
+
|
75
|
+
# Offense count: 2
|
76
|
+
# Cop supports --auto-correct.
|
77
|
+
RSpec/EmptyLineAfterFinalLet:
|
78
|
+
Exclude:
|
79
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
80
|
+
- 'spec/classes/settings_spec.rb'
|
81
|
+
|
82
|
+
# Offense count: 1
|
83
|
+
# Configuration parameters: Max.
|
84
|
+
RSpec/ExampleLength:
|
85
|
+
Exclude:
|
86
|
+
- 'spec/pdfh_spec.rb'
|
87
|
+
|
88
|
+
# Offense count: 1
|
89
|
+
RSpec/ExpectInHook:
|
90
|
+
Exclude:
|
91
|
+
- 'spec/pdfh_spec.rb'
|
92
|
+
|
93
|
+
# Offense count: 6
|
94
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
95
|
+
# Include: **/*_spec*rb*, **/spec/**/*
|
96
|
+
RSpec/FilePath:
|
97
|
+
Exclude:
|
98
|
+
- 'spec/classes/document_spec.rb'
|
99
|
+
- 'spec/classes/dry_spec.rb'
|
100
|
+
- 'spec/classes/month_spec.rb'
|
101
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
102
|
+
- 'spec/classes/settings_spec.rb'
|
103
|
+
- 'spec/classes/verbose_spec.rb'
|
104
|
+
|
105
|
+
# Offense count: 3
|
106
|
+
# Cop supports --auto-correct.
|
107
|
+
RSpec/LeadingSubject:
|
108
|
+
Exclude:
|
109
|
+
- 'spec/classes/document_spec.rb'
|
110
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
111
|
+
- 'spec/classes/settings_spec.rb'
|
112
|
+
|
113
|
+
# Offense count: 18
|
114
|
+
# Configuration parameters: .
|
115
|
+
# SupportedStyles: have_received, receive
|
116
|
+
RSpec/MessageSpies:
|
117
|
+
EnforcedStyle: receive
|
118
|
+
|
119
|
+
# Offense count: 15
|
120
|
+
RSpec/MultipleExpectations:
|
121
|
+
Max: 4
|
122
|
+
|
123
|
+
# Offense count: 71
|
124
|
+
# Configuration parameters: IgnoreSharedExamples.
|
125
|
+
RSpec/NamedSubject:
|
126
|
+
Exclude:
|
127
|
+
- 'spec/classes/document_spec.rb'
|
128
|
+
- 'spec/classes/month_spec.rb'
|
129
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
130
|
+
- 'spec/classes/settings_spec.rb'
|
131
|
+
- 'spec/pdfh_spec.rb'
|
132
|
+
|
133
|
+
# Offense count: 16
|
134
|
+
RSpec/StubbedMock:
|
135
|
+
Exclude:
|
136
|
+
- 'spec/classes/document_spec.rb'
|
137
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
138
|
+
- 'spec/pdfh_spec.rb'
|
139
|
+
|
140
|
+
# Offense count: 7
|
141
|
+
RSpec/SubjectStub:
|
142
|
+
Exclude:
|
143
|
+
- 'spec/classes/document_spec.rb'
|
144
|
+
- 'spec/classes/pdf_handler_spec.rb'
|
145
|
+
- 'spec/pdfh_spec.rb'
|
146
|
+
|
147
|
+
# Offense count: 4
|
148
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
149
|
+
RSpec/VerifiedDoubles:
|
150
|
+
Exclude:
|
151
|
+
- 'spec/classes/document_spec.rb'
|
152
|
+
- 'spec/pdfh_spec.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
ruby-3.0.0
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
4
|
-
|
5
|
-
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
3
|
+
source "https://rubygems.org"
|
6
4
|
|
7
5
|
# Specify your gem's dependencies in pdfh.gemspec
|
8
6
|
gemspec
|
7
|
+
|
8
|
+
gem "bundler", "~> 2.0"
|
9
|
+
gem "pry", "~> 0.14"
|
10
|
+
gem "rake", "~> 13.0"
|
11
|
+
gem "rspec", "~> 3.9"
|
12
|
+
gem "rspec_junit_formatter", "~> 0.4"
|
13
|
+
gem "rubocop", "~> 1.0"
|
14
|
+
gem "rubocop-performance", "~> 1.9"
|
15
|
+
gem "rubocop-rake", "~> 0.5"
|
16
|
+
gem "rubocop-rspec", "~> 2.2"
|
17
|
+
gem "simplecov", "~> 0.21"
|
18
|
+
gem "simplecov-console", "~> 0.9"
|
19
|
+
gem "versionomy", "~> 0.5"
|
data/Gemfile.lock
CHANGED
@@ -1,64 +1,76 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pdfh (0.1.
|
4
|
+
pdfh (0.1.9)
|
5
5
|
colorize (~> 0.8.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ansi (1.5.0)
|
11
|
-
ast (2.4.
|
11
|
+
ast (2.4.2)
|
12
12
|
blockenspiel (0.5.0)
|
13
13
|
coderay (1.1.3)
|
14
14
|
colorize (0.8.1)
|
15
15
|
diff-lcs (1.4.4)
|
16
|
-
docile (1.3.
|
16
|
+
docile (1.3.5)
|
17
17
|
method_source (1.0.0)
|
18
|
-
parallel (1.
|
19
|
-
parser (
|
18
|
+
parallel (1.20.1)
|
19
|
+
parser (3.0.0.0)
|
20
20
|
ast (~> 2.4.1)
|
21
|
-
pry (0.
|
21
|
+
pry (0.14.0)
|
22
22
|
coderay (~> 1.1)
|
23
23
|
method_source (~> 1.0)
|
24
24
|
rainbow (3.0.0)
|
25
|
-
rake (13.0.
|
26
|
-
regexp_parser (1.
|
25
|
+
rake (13.0.3)
|
26
|
+
regexp_parser (2.1.1)
|
27
27
|
rexml (3.2.4)
|
28
|
-
rspec (3.
|
29
|
-
rspec-core (~> 3.
|
30
|
-
rspec-expectations (~> 3.
|
31
|
-
rspec-mocks (~> 3.
|
32
|
-
rspec-core (3.
|
33
|
-
rspec-support (~> 3.
|
34
|
-
rspec-expectations (3.
|
28
|
+
rspec (3.10.0)
|
29
|
+
rspec-core (~> 3.10.0)
|
30
|
+
rspec-expectations (~> 3.10.0)
|
31
|
+
rspec-mocks (~> 3.10.0)
|
32
|
+
rspec-core (3.10.1)
|
33
|
+
rspec-support (~> 3.10.0)
|
34
|
+
rspec-expectations (3.10.1)
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-mocks (3.
|
36
|
+
rspec-support (~> 3.10.0)
|
37
|
+
rspec-mocks (3.10.2)
|
38
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-support (3.
|
41
|
-
|
39
|
+
rspec-support (~> 3.10.0)
|
40
|
+
rspec-support (3.10.2)
|
41
|
+
rspec_junit_formatter (0.4.1)
|
42
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
43
|
+
rubocop (1.11.0)
|
42
44
|
parallel (~> 1.10)
|
43
|
-
parser (>=
|
45
|
+
parser (>= 3.0.0.0)
|
44
46
|
rainbow (>= 2.2.2, < 4.0)
|
45
|
-
regexp_parser (>= 1.
|
47
|
+
regexp_parser (>= 1.8, < 3.0)
|
46
48
|
rexml
|
47
|
-
rubocop-ast (>=
|
49
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
48
50
|
ruby-progressbar (~> 1.7)
|
49
|
-
unicode-display_width (>= 1.4.0, <
|
50
|
-
rubocop-ast (
|
51
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
52
|
+
rubocop-ast (1.4.1)
|
51
53
|
parser (>= 2.7.1.5)
|
52
|
-
|
53
|
-
|
54
|
+
rubocop-performance (1.10.1)
|
55
|
+
rubocop (>= 0.90.0, < 2.0)
|
56
|
+
rubocop-ast (>= 0.4.0)
|
57
|
+
rubocop-rake (0.5.1)
|
58
|
+
rubocop
|
59
|
+
rubocop-rspec (2.2.0)
|
60
|
+
rubocop (~> 1.0)
|
61
|
+
rubocop-ast (>= 1.1.0)
|
62
|
+
ruby-progressbar (1.11.0)
|
63
|
+
simplecov (0.21.2)
|
54
64
|
docile (~> 1.1)
|
55
65
|
simplecov-html (~> 0.11)
|
56
|
-
|
66
|
+
simplecov_json_formatter (~> 0.1)
|
67
|
+
simplecov-console (0.9.1)
|
57
68
|
ansi
|
58
69
|
simplecov
|
59
70
|
terminal-table
|
60
71
|
simplecov-html (0.12.3)
|
61
|
-
|
72
|
+
simplecov_json_formatter (0.1.2)
|
73
|
+
terminal-table (3.0.0)
|
62
74
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
63
75
|
unicode-display_width (1.7.0)
|
64
76
|
versionomy (0.5.0)
|
@@ -70,13 +82,17 @@ PLATFORMS
|
|
70
82
|
DEPENDENCIES
|
71
83
|
bundler (~> 2.0)
|
72
84
|
pdfh!
|
73
|
-
pry
|
85
|
+
pry (~> 0.14)
|
74
86
|
rake (~> 13.0)
|
75
|
-
rspec (~> 3.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
87
|
+
rspec (~> 3.9)
|
88
|
+
rspec_junit_formatter (~> 0.4)
|
89
|
+
rubocop (~> 1.0)
|
90
|
+
rubocop-performance (~> 1.9)
|
91
|
+
rubocop-rake (~> 0.5)
|
92
|
+
rubocop-rspec (~> 2.2)
|
93
|
+
simplecov (~> 0.21)
|
94
|
+
simplecov-console (~> 0.9)
|
95
|
+
versionomy (~> 0.5)
|
80
96
|
|
81
97
|
BUNDLED WITH
|
82
|
-
2.
|
98
|
+
2.2.12
|
data/README.md
CHANGED
@@ -8,6 +8,15 @@ Examine all PDF files in scrape directories, remove password (if has one), renam
|
|
8
8
|
gem install pdfh
|
9
9
|
```
|
10
10
|
|
11
|
+
### Dependencies
|
12
|
+
|
13
|
+
You need to install pdf handling dependencies in order to use this gem. (I have only tested it on macOS)
|
14
|
+
|
15
|
+
```bash
|
16
|
+
brew install qpdf
|
17
|
+
brew install xpdf
|
18
|
+
```
|
19
|
+
|
11
20
|
## Usage
|
12
21
|
|
13
22
|
After installing this gem you need to create your configuration file on your home folder.
|
data/Rakefile
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require "colorize"
|
4
|
+
require "bundler/gem_tasks"
|
5
|
+
require "rspec/core/rake_task"
|
6
|
+
require "versionomy"
|
7
7
|
|
8
8
|
RSpec::Core::RakeTask.new(:spec)
|
9
9
|
|
10
10
|
task default: :spec
|
11
11
|
|
12
|
-
desc
|
12
|
+
desc "Bump gem version number (tiny|minor|major)"
|
13
13
|
task :bump, :type do |_t, args|
|
14
14
|
args.with_defaults(type: :tiny)
|
15
|
-
version_file = File.join(__dir__,
|
15
|
+
version_file = File.join(__dir__, "lib", "pdfh", "version.rb")
|
16
16
|
content = File.read(version_file)
|
17
17
|
|
18
18
|
version_pattern = /(?<major>\d+)\.(?<minor>\d+)\.(?<tiny>\d+)/
|