pdfh 3.3.0 → 3.3.1

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: 29f90e2cbc737c2ea6f15b58f6a46513d90ac68053c770018a5a2549b76adcc6
4
- data.tar.gz: 476440f76e4cd8eb0cdc248d9040cbf75fc510656ff1129d83d18bc1f9edf8ec
3
+ metadata.gz: 6e6f4e14950562b2b4f308dabe361ac5fb73191dd456523aeb6469e7c97cdf00
4
+ data.tar.gz: ce3523404e6a5bf37613b281afb8957d35f3b843dc301996377057a79a65da1b
5
5
  SHA512:
6
- metadata.gz: 10672062c7041f020920bf4c51a9af88d82130d4db59f8a332a5b05df055bf6079c127b4c8d7d31fb145f9fc88b9527bc330a83f23d2f0dc69c92e843c8246ba
7
- data.tar.gz: 606afc6611bb8036cd073c8a5a031dbc0812d2385de77d1b774c2c49b42673f266e4020c679a558dc3d709b3309e1e9d8708d2a8a7b6808f66b4d1ae770da780
6
+ metadata.gz: 8e44d1c076c9825555e6c4c9ac3c5ec8efa0e03612aca314d4c7fc5f17980590b0b38fb1c3fd77573912edeeb5d7ae11bb06749eeffe7e3c031536125c1f99e3
7
+ data.tar.gz: 68643552fd0d663acb8fb9a107ba6c52938a0e42adc77e19ef877b603656cf81633abe1bb36d1dcf2d4df73b68a401b86ae55c050eea35640afc132c3240365a
data/.editorconfig ADDED
@@ -0,0 +1,31 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 2
10
+ max_line_length = 120
11
+
12
+ [*.py]
13
+ indent_size = 4
14
+
15
+ [*.rb]
16
+ indent_size = 2
17
+
18
+ [*.md]
19
+ trim_trailing_whitespace = false
20
+
21
+ [*.yml]
22
+ indent_size = 2
23
+
24
+ [*.yaml]
25
+ indent_size = 2
26
+
27
+ [*.json]
28
+ indent_size = 2
29
+
30
+ [*.{js,jsx,ts,tsx}]
31
+ indent_size = 2
@@ -6,31 +6,39 @@ default_install_hook_types:
6
6
 
7
7
  repos:
8
8
  - repo: https://github.com/pre-commit/pre-commit-hooks
9
- rev: v5.0.0
9
+ rev: v6.0.0
10
10
  hooks:
11
11
  - id: trailing-whitespace
12
+ args: [--markdown-linebreak-ext=md]
12
13
  - id: end-of-file-fixer
13
14
  exclude: ^.idea/
14
15
  - id: check-yaml
15
16
  - id: check-added-large-files
17
+ args: [--maxkb=1000]
16
18
  - id: check-executables-have-shebangs
17
19
  - id: check-shebang-scripts-are-executable
18
20
  - id: mixed-line-ending
21
+ args: [--fix=lf]
22
+
19
23
  - repo: https://github.com/gitleaks/gitleaks
20
- rev: v8.25.0
24
+ rev: v8.30.0
21
25
  hooks:
22
26
  - id: gitleaks
27
+
23
28
  - repo: https://github.com/rubocop/rubocop
24
- rev: v1.75.4
29
+ rev: v1.85.1
25
30
  hooks:
26
31
  - id: rubocop
32
+ args: [--parallel]
33
+
27
34
  - repo: https://github.com/compilerla/conventional-pre-commit
28
- rev: v4.1.0
35
+ rev: v4.4.0
29
36
  hooks:
30
37
  - id: conventional-pre-commit
31
38
  stages: [commit-msg]
32
39
  args: []
40
+
33
41
  - repo: https://github.com/codespell-project/codespell
34
- rev: v2.4.1
42
+ rev: v2.4.2
35
43
  hooks:
36
44
  - id: codespell
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in pdfh.gemspec
6
6
  gemspec
7
7
 
8
- gem "bundler", "~> 2.0"
8
+ gem "bundler", "~> 4.0"
9
9
  gem "code-scanning-rubocop", "~> 0.5"
10
10
  gem "debug", "~> 1.8"
11
11
  gem "factory_bot", "~> 6.2"
@@ -13,10 +13,11 @@ gem "pry", "~> 0.14"
13
13
  gem "rake", "~> 13.0"
14
14
  gem "rspec", "~> 3.12"
15
15
  gem "rspec_junit_formatter", "~> 0.4"
16
- gem "rubocop", "~> 1.50"
16
+ gem "rubocop", "~> 1.81"
17
+ gem "rubocop-factory_bot", "~> 2.27"
17
18
  gem "rubocop-performance", "~> 1.18"
18
19
  gem "rubocop-rake", "~> 0.5"
19
- gem "rubocop-rspec", "~> 2.2"
20
+ gem "rubocop-rspec", "~> 3.7"
20
21
  gem "simplecov", "~> 0.22"
21
22
  gem "simplecov-console", "~> 0.9"
22
23
  gem "versionomy", "~> 0.5"
data/Gemfile.lock CHANGED
@@ -1,20 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pdfh (3.3.0)
4
+ pdfh (3.3.1)
5
5
  colorize (~> 1.1.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (8.0.2)
10
+ activesupport (8.1.1)
11
11
  base64
12
- benchmark (>= 0.3)
13
12
  bigdecimal
14
13
  concurrent-ruby (~> 1.0, >= 1.3.1)
15
14
  connection_pool (>= 2.2.5)
16
15
  drb
17
16
  i18n (>= 1.6, < 2)
17
+ json
18
18
  logger (>= 1.4.2)
19
19
  minitest (>= 5.1)
20
20
  securerandom (>= 0.3)
@@ -22,76 +22,80 @@ GEM
22
22
  uri (>= 0.13.1)
23
23
  ansi (1.5.0)
24
24
  ast (2.4.3)
25
- base64 (0.2.0)
26
- benchmark (0.4.0)
27
- bigdecimal (3.1.9)
25
+ base64 (0.3.0)
26
+ bigdecimal (4.0.1)
28
27
  blockenspiel (0.5.0)
29
28
  code-scanning-rubocop (0.6.1)
30
29
  rubocop (~> 1.0)
31
30
  coderay (1.1.3)
32
31
  colorize (1.1.0)
33
- concurrent-ruby (1.3.5)
34
- connection_pool (2.5.3)
35
- date (3.4.1)
36
- debug (1.10.0)
32
+ concurrent-ruby (1.3.6)
33
+ connection_pool (3.0.2)
34
+ date (3.5.1)
35
+ debug (1.11.1)
37
36
  irb (~> 1.10)
38
37
  reline (>= 0.3.8)
39
- diff-lcs (1.6.1)
38
+ diff-lcs (1.6.2)
40
39
  docile (1.4.1)
41
- drb (2.2.1)
42
- factory_bot (6.5.1)
40
+ drb (2.2.3)
41
+ erb (6.0.1)
42
+ factory_bot (6.5.6)
43
43
  activesupport (>= 6.1.0)
44
- i18n (1.14.7)
44
+ i18n (1.14.8)
45
45
  concurrent-ruby (~> 1.0)
46
- io-console (0.8.0)
47
- irb (1.15.2)
46
+ io-console (0.8.2)
47
+ irb (1.16.0)
48
48
  pp (>= 0.6.0)
49
49
  rdoc (>= 4.0.0)
50
50
  reline (>= 0.4.2)
51
- json (2.11.3)
52
- language_server-protocol (3.17.0.4)
51
+ json (2.18.0)
52
+ language_server-protocol (3.17.0.5)
53
53
  lint_roller (1.1.0)
54
54
  logger (1.7.0)
55
55
  method_source (1.1.0)
56
- minitest (5.25.5)
56
+ minitest (6.0.1)
57
+ prism (~> 1.5)
57
58
  parallel (1.27.0)
58
- parser (3.3.8.0)
59
+ parser (3.3.10.0)
59
60
  ast (~> 2.4.1)
60
61
  racc
61
- pp (0.6.2)
62
+ pp (0.6.3)
62
63
  prettyprint
63
64
  prettyprint (0.2.0)
64
- prism (1.4.0)
65
- pry (0.15.2)
65
+ prism (1.7.0)
66
+ pry (0.16.0)
66
67
  coderay (~> 1.1)
67
68
  method_source (~> 1.0)
68
- psych (5.2.4)
69
+ reline (>= 0.6.0)
70
+ psych (5.3.1)
69
71
  date
70
72
  stringio
71
73
  racc (1.8.1)
72
74
  rainbow (3.1.1)
73
- rake (13.2.1)
74
- rdoc (6.13.1)
75
+ rake (13.3.1)
76
+ rdoc (7.0.3)
77
+ erb
75
78
  psych (>= 4.0.0)
76
- regexp_parser (2.10.0)
77
- reline (0.6.1)
79
+ tsort
80
+ regexp_parser (2.11.3)
81
+ reline (0.6.3)
78
82
  io-console (~> 0.5)
79
- rspec (3.13.0)
83
+ rspec (3.13.2)
80
84
  rspec-core (~> 3.13.0)
81
85
  rspec-expectations (~> 3.13.0)
82
86
  rspec-mocks (~> 3.13.0)
83
- rspec-core (3.13.3)
87
+ rspec-core (3.13.6)
84
88
  rspec-support (~> 3.13.0)
85
- rspec-expectations (3.13.4)
89
+ rspec-expectations (3.13.5)
86
90
  diff-lcs (>= 1.2.0, < 2.0)
87
91
  rspec-support (~> 3.13.0)
88
- rspec-mocks (3.13.4)
92
+ rspec-mocks (3.13.7)
89
93
  diff-lcs (>= 1.2.0, < 2.0)
90
94
  rspec-support (~> 3.13.0)
91
- rspec-support (3.13.3)
95
+ rspec-support (3.13.6)
92
96
  rspec_junit_formatter (0.6.0)
93
97
  rspec-core (>= 2, < 4, != 2.12.0)
94
- rubocop (1.75.5)
98
+ rubocop (1.82.1)
95
99
  json (~> 2.3)
96
100
  language_server-protocol (~> 3.17.0.2)
97
101
  lint_roller (~> 1.1.0)
@@ -99,53 +103,47 @@ GEM
99
103
  parser (>= 3.3.0.2)
100
104
  rainbow (>= 2.2.2, < 4.0)
101
105
  regexp_parser (>= 2.9.3, < 3.0)
102
- rubocop-ast (>= 1.44.0, < 2.0)
106
+ rubocop-ast (>= 1.48.0, < 2.0)
103
107
  ruby-progressbar (~> 1.7)
104
108
  unicode-display_width (>= 2.4.0, < 4.0)
105
- rubocop-ast (1.44.1)
109
+ rubocop-ast (1.49.0)
106
110
  parser (>= 3.3.7.2)
107
- prism (~> 1.4)
108
- rubocop-capybara (2.22.1)
111
+ prism (~> 1.7)
112
+ rubocop-factory_bot (2.28.0)
109
113
  lint_roller (~> 1.1)
110
114
  rubocop (~> 1.72, >= 1.72.1)
111
- rubocop-factory_bot (2.27.1)
112
- lint_roller (~> 1.1)
113
- rubocop (~> 1.72, >= 1.72.1)
114
- rubocop-performance (1.25.0)
115
+ rubocop-performance (1.26.1)
115
116
  lint_roller (~> 1.1)
116
117
  rubocop (>= 1.75.0, < 2.0)
117
- rubocop-ast (>= 1.38.0, < 2.0)
118
+ rubocop-ast (>= 1.47.1, < 2.0)
118
119
  rubocop-rake (0.7.1)
119
120
  lint_roller (~> 1.1)
120
121
  rubocop (>= 1.72.1)
121
- rubocop-rspec (2.31.0)
122
- rubocop (~> 1.40)
123
- rubocop-capybara (~> 2.17)
124
- rubocop-factory_bot (~> 2.22)
125
- rubocop-rspec_rails (~> 2.28)
126
- rubocop-rspec_rails (2.29.1)
127
- rubocop (~> 1.61)
122
+ rubocop-rspec (3.9.0)
123
+ lint_roller (~> 1.1)
124
+ rubocop (~> 1.81)
128
125
  ruby-progressbar (1.13.0)
129
126
  securerandom (0.4.1)
130
127
  simplecov (0.22.0)
131
128
  docile (~> 1.1)
132
129
  simplecov-html (~> 0.11)
133
130
  simplecov_json_formatter (~> 0.1)
134
- simplecov-console (0.9.3)
131
+ simplecov-console (0.9.4)
135
132
  ansi
136
133
  simplecov
137
134
  terminal-table
138
- simplecov-html (0.13.1)
135
+ simplecov-html (0.13.2)
139
136
  simplecov_json_formatter (0.1.4)
140
- stringio (3.1.7)
137
+ stringio (3.2.0)
141
138
  terminal-table (4.0.0)
142
139
  unicode-display_width (>= 1.1.1, < 4)
140
+ tsort (0.2.0)
143
141
  tzinfo (2.0.6)
144
142
  concurrent-ruby (~> 1.0)
145
- unicode-display_width (3.1.4)
146
- unicode-emoji (~> 4.0, >= 4.0.4)
147
- unicode-emoji (4.0.4)
148
- uri (1.0.3)
143
+ unicode-display_width (3.2.0)
144
+ unicode-emoji (~> 4.1)
145
+ unicode-emoji (4.2.0)
146
+ uri (1.1.1)
149
147
  versionomy (0.5.0)
150
148
  blockenspiel (~> 0.5)
151
149
 
@@ -153,7 +151,7 @@ PLATFORMS
153
151
  ruby
154
152
 
155
153
  DEPENDENCIES
156
- bundler (~> 2.0)
154
+ bundler (~> 4.0)
157
155
  code-scanning-rubocop (~> 0.5)
158
156
  debug (~> 1.8)
159
157
  factory_bot (~> 6.2)
@@ -162,13 +160,14 @@ DEPENDENCIES
162
160
  rake (~> 13.0)
163
161
  rspec (~> 3.12)
164
162
  rspec_junit_formatter (~> 0.4)
165
- rubocop (~> 1.50)
163
+ rubocop (~> 1.81)
164
+ rubocop-factory_bot (~> 2.27)
166
165
  rubocop-performance (~> 1.18)
167
166
  rubocop-rake (~> 0.5)
168
- rubocop-rspec (~> 2.2)
167
+ rubocop-rspec (~> 3.7)
169
168
  simplecov (~> 0.22)
170
169
  simplecov-console (~> 0.9)
171
170
  versionomy (~> 0.5)
172
171
 
173
172
  BUNDLED WITH
174
- 2.6.8
173
+ 4.0.3
data/commitlint.config.js CHANGED
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- extends: ['@commitlint/config-conventional'],
2
+ extends: ['@commitlint/config-conventional'],
3
3
  }
@@ -5,6 +5,8 @@ module Pdfh
5
5
  class DocumentType
6
6
  include Concerns::PasswordDecodable
7
7
 
8
+ REQUIRED_FIELDS = %i[name re_file re_date store_path].freeze
9
+
8
10
  # @!attribute [r] name
9
11
  # @return [String] The name of the document type.
10
12
  # @!attribute [r] re_file
@@ -68,6 +68,8 @@ module Pdfh
68
68
  # @return [void]
69
69
  def build_doc_types(doc_types)
70
70
  @document_types = doc_types.each_with_object({}) do |data, result|
71
+ next if missing_required_fields?(data)
72
+
71
73
  doc_type = DocumentType.new(data)
72
74
  result.store(doc_type.gid, doc_type)
73
75
  rescue ArgumentError => e
@@ -76,6 +78,18 @@ module Pdfh
76
78
  end
77
79
  end
78
80
 
81
+ def missing_required_fields?(data)
82
+ missing_fields = DocumentType::REQUIRED_FIELDS.select { |field| data[field].nil? || data[field].to_s.empty? }
83
+ if missing_fields.any?
84
+ type_name = data[:name] || "Unnamed type"
85
+ missing_fields_names = missing_fields.join(", ")
86
+ Pdfh.info format("Skipping document type %<type_name>s. Missing required fields: %<missing_fields>s",
87
+ type_name: type_name.colorize(:green),
88
+ missing_fields: missing_fields_names.colorize(:red))
89
+ end
90
+ missing_fields.any?
91
+ end
92
+
79
93
  # @param zip_types [Array<Hash>]
80
94
  # @return [void]
81
95
  def build_zip_types(zip_types)
data/lib/pdfh/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pdfh
4
- VERSION = "3.3.0"
4
+ VERSION = "3.3.1"
5
5
  end
data/lib/pdfh.rb CHANGED
@@ -51,6 +51,7 @@ module Pdfh
51
51
 
52
52
  class << self
53
53
  extend Forwardable
54
+
54
55
  def_delegators :@options, :verbose?, :dry?, :file_mode?
55
56
  def_delegators :@console, :ident_print, :warn_print, :error_print, :backtrace_print, :headline, :debug, :info,
56
57
  :print_options
data/mise.toml CHANGED
@@ -1,2 +1,9 @@
1
1
  [tools]
2
- ruby = "3.4.3"
2
+ ruby = "4.0"
3
+
4
+ [tasks]
5
+ update = "bundle outdated && bundle update && bundle update --bundler"
6
+ update-tools = "pre-commit autoupdate"
7
+ pre = "pre-commit run --all-files"
8
+ lint = "bundle exec rubocop"
9
+ test = "bundle exec rspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfh
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaias Piña
@@ -32,6 +32,7 @@ executables:
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
+ - ".editorconfig"
35
36
  - ".gitignore"
36
37
  - ".pre-commit-config.yaml"
37
38
  - ".rspec"
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubygems_version: 3.6.8
98
+ rubygems_version: 4.0.7
98
99
  specification_version: 4
99
100
  summary: Organize PDF files
100
101
  test_files: []