Icarus-Mod-Tools 3.0.0 → 3.1.0

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: 17d3d3cdfeeb5953e405d4888f0c748b00d330af51a14714c51e04b927baedb9
4
- data.tar.gz: 29f015ac208933825b954bb33fda452cd684499f8e2e10950d241e0a4323fbac
3
+ metadata.gz: 1ce21bb90f71e739bad403f4f8c30a29d4f1c10ecd374ecd4012d2273a49d583
4
+ data.tar.gz: ff4adcb3bf12dae9bee5c0570c1c9b93c0ce062888014ee916ebf52fcf66e3ff
5
5
  SHA512:
6
- metadata.gz: fad56b2b02cfd1412d332f2d47be963ef557ce21bfa25f3af6b103ee99ab4cb632517e23a59d7d512cbc339746906392396133b238d004e9c0ef82a23e76fc3e
7
- data.tar.gz: bd460ed0255ede73b7cda973e0d0a39c22a2a285600e6f2399920905c1b626e2b40dc65599578f67e50b8f8c609238fde203eb7b3cd4090c3c3ef7e24d3fb974
6
+ metadata.gz: '08bb649e40e165fa13072434fb0f70bb62d7f67a8309f02b7ad06b2b40986510a7176771f711dcbaec0c0b727643b31a3e6d95e877e0e53cfc37f67a761153fb'
7
+ data.tar.gz: 765209817e047371f78c2df064a6294c0ffbb30c40454ad1771cdabba0c93bf5d0c2384d446c38aafd3f4d6eaae587b2f12af09e42a1ccc1f7ea6d19721d2a23
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## History (reverse chronological order)
6
6
 
7
+ ### v3.1.0 - 2026-10-30
8
+
9
+ - `imt sync mods`/`tools --dry-run` now lists the entries a real run would delete, and warns when the mass-delete brake would refuse (a real run would exit 1 without `--force`)
10
+ - Document `imt add --dry-run` in the README
11
+ - Update `google-cloud-firestore` to 3.x and `octokit` to 10.x (no API changes affect `imt`)
12
+ - Update development tools (`pry` 0.16, `guard`, `rake`)
13
+
7
14
  ### v3.0.0 - 2026-10-30
8
15
 
9
16
  **Breaking:** requires Ruby 4.0 or greater. Sync commands now exit 1 on failure, and `imt sync mods`/`tools` refuse a mass delete without `--force`.
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ group :development do
11
11
  gem "fuubar"
12
12
  gem "guard", "~> 2.18"
13
13
  gem "guard-rspec", "~> 4.7"
14
- gem "pry", "~> 0.14.1"
14
+ gem "pry", "~> 0.16"
15
15
  gem "rspec", "~> 3.12"
16
16
  gem "rubocop", "~> 1.92"
17
17
  gem "rubocop-rspec", "~> 3.10", require: false
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Icarus-Mod-Tools (3.0.0)
5
- google-cloud-firestore (~> 2.7)
6
- octokit (~> 6.0)
4
+ Icarus-Mod-Tools (3.1.0)
5
+ google-cloud-firestore (~> 3.3)
6
+ octokit (~> 10.0)
7
7
  ostruct (~> 0.6)
8
8
  paint (~> 2.3)
9
9
  thor (~> 1.2)
@@ -23,7 +23,7 @@ GEM
23
23
  faraday-net_http (>= 2.0, < 3.6)
24
24
  json
25
25
  logger
26
- faraday-net_http (3.4.2)
26
+ faraday-net_http (3.5.0)
27
27
  net-http (~> 0.5)
28
28
  faraday-retry (2.4.0)
29
29
  faraday (~> 2.0)
@@ -43,7 +43,7 @@ GEM
43
43
  fuubar (2.5.1)
44
44
  rspec-core (~> 3.0)
45
45
  ruby-progressbar (~> 1.4)
46
- gapic-common (1.2.0)
46
+ gapic-common (1.6.1)
47
47
  faraday (>= 1.9, < 3.a)
48
48
  faraday-retry (>= 1.0, < 3.a)
49
49
  google-cloud-env (~> 2.2)
@@ -52,73 +52,97 @@ GEM
52
52
  googleapis-common-protos (~> 1.6)
53
53
  googleapis-common-protos-types (~> 1.15)
54
54
  googleauth (~> 1.12)
55
- grpc (~> 1.66)
56
- google-cloud-core (1.8.0)
55
+ grpc (>= 1.84.1, < 2.a)
56
+ google-cloud-core (1.9.1)
57
57
  google-cloud-env (>= 1.0, < 3.a)
58
58
  google-cloud-errors (~> 1.0)
59
- google-cloud-env (2.3.1)
59
+ google-cloud-env (2.4.1)
60
60
  base64 (~> 0.2)
61
61
  faraday (>= 1.0, < 3.a)
62
- google-cloud-errors (1.5.0)
63
- google-cloud-firestore (2.16.1)
62
+ google-cloud-errors (1.7.1)
63
+ google-cloud-firestore (3.3.0)
64
64
  bigdecimal (~> 3.0)
65
65
  concurrent-ruby (~> 1.0)
66
- google-cloud-core (~> 1.5)
67
- google-cloud-firestore-v1 (>= 0.10, < 2.a)
66
+ google-cloud-core (~> 1.7)
67
+ google-cloud-firestore-v1 (~> 2.0)
68
68
  rbtree (~> 0.4.2)
69
- google-cloud-firestore-v1 (1.3.0)
70
- gapic-common (>= 0.25.0, < 2.a)
69
+ google-cloud-firestore-v1 (2.6.0)
70
+ gapic-common (~> 1.6)
71
71
  google-cloud-errors (~> 1.0)
72
- google-cloud-location (>= 0.7, < 2.a)
73
- google-cloud-location (1.2.1)
74
- gapic-common (~> 1.2)
72
+ google-cloud-location (~> 1.0)
73
+ google-cloud-location (1.6.0)
74
+ gapic-common (~> 1.6)
75
75
  google-cloud-errors (~> 1.0)
76
- google-logging-utils (0.2.0)
77
- google-protobuf (4.33.4)
76
+ google-logging-utils (0.2.2)
77
+ google-protobuf (4.36.2)
78
78
  bigdecimal
79
- rake (>= 13)
80
- googleapis-common-protos (1.9.0)
79
+ rake (~> 13.3)
80
+ google-protobuf (4.36.2-aarch64-linux-gnu)
81
+ bigdecimal
82
+ rake (~> 13.3)
83
+ google-protobuf (4.36.2-aarch64-linux-musl)
84
+ bigdecimal
85
+ rake (~> 13.3)
86
+ google-protobuf (4.36.2-arm64-darwin)
87
+ bigdecimal
88
+ rake (~> 13.3)
89
+ google-protobuf (4.36.2-x86-linux-gnu)
90
+ bigdecimal
91
+ rake (~> 13.3)
92
+ google-protobuf (4.36.2-x86-linux-musl)
93
+ bigdecimal
94
+ rake (~> 13.3)
95
+ google-protobuf (4.36.2-x86_64-darwin)
96
+ bigdecimal
97
+ rake (~> 13.3)
98
+ google-protobuf (4.36.2-x86_64-linux-gnu)
99
+ bigdecimal
100
+ rake (~> 13.3)
101
+ google-protobuf (4.36.2-x86_64-linux-musl)
102
+ bigdecimal
103
+ rake (~> 13.3)
104
+ googleapis-common-protos (1.11.0)
81
105
  google-protobuf (~> 4.26)
82
106
  googleapis-common-protos-types (~> 1.21)
83
- grpc (~> 1.41)
84
- googleapis-common-protos-types (1.22.0)
107
+ grpc (>= 1.84.1, < 2.a)
108
+ googleapis-common-protos-types (1.24.0)
85
109
  google-protobuf (~> 4.26)
86
- googleauth (1.16.1)
110
+ googleauth (1.17.7)
87
111
  faraday (>= 1.0, < 3.a)
88
112
  google-cloud-env (~> 2.2)
89
113
  google-logging-utils (~> 0.1)
90
114
  jwt (>= 1.4, < 4.0)
91
- multi_json (~> 1.11)
92
115
  os (>= 0.9, < 2.0)
116
+ pstore (~> 0.1)
93
117
  signet (>= 0.16, < 2.a)
94
- grpc (1.76.0)
118
+ grpc (1.85.0)
95
119
  google-protobuf (>= 3.25, < 5.0)
96
120
  googleapis-common-protos-types (~> 1.0)
97
- grpc (1.76.0-aarch64-linux-gnu)
121
+ grpc (1.85.0-aarch64-linux-gnu)
98
122
  google-protobuf (>= 3.25, < 5.0)
99
123
  googleapis-common-protos-types (~> 1.0)
100
- grpc (1.76.0-aarch64-linux-musl)
124
+ grpc (1.85.0-aarch64-linux-musl)
101
125
  google-protobuf (>= 3.25, < 5.0)
102
126
  googleapis-common-protos-types (~> 1.0)
103
- grpc (1.76.0-arm64-darwin)
127
+ grpc (1.85.0-arm64-darwin)
104
128
  google-protobuf (>= 3.25, < 5.0)
105
129
  googleapis-common-protos-types (~> 1.0)
106
- grpc (1.76.0-x86-linux-gnu)
130
+ grpc (1.85.0-x86-linux-gnu)
107
131
  google-protobuf (>= 3.25, < 5.0)
108
132
  googleapis-common-protos-types (~> 1.0)
109
- grpc (1.76.0-x86-linux-musl)
133
+ grpc (1.85.0-x86-linux-musl)
110
134
  google-protobuf (>= 3.25, < 5.0)
111
135
  googleapis-common-protos-types (~> 1.0)
112
- grpc (1.76.0-x86_64-darwin)
136
+ grpc (1.85.0-x86_64-darwin)
113
137
  google-protobuf (>= 3.25, < 5.0)
114
138
  googleapis-common-protos-types (~> 1.0)
115
- grpc (1.76.0-x86_64-linux-gnu)
139
+ grpc (1.85.0-x86_64-linux-gnu)
116
140
  google-protobuf (>= 3.25, < 5.0)
117
141
  googleapis-common-protos-types (~> 1.0)
118
- grpc (1.76.0-x86_64-linux-musl)
142
+ grpc (1.85.0-x86_64-linux-musl)
119
143
  google-protobuf (>= 3.25, < 5.0)
120
144
  googleapis-common-protos-types (~> 1.0)
121
- guard (2.20.0)
145
+ guard (2.20.2)
122
146
  formatador (>= 0.2.4)
123
147
  listen (>= 2.7, < 4.0)
124
148
  logger (~> 1.6)
@@ -146,14 +170,16 @@ GEM
146
170
  logger (1.7.0)
147
171
  lumberjack (1.4.2)
148
172
  method_source (1.1.0)
149
- multi_json (1.21.2)
150
173
  nenv (0.3.0)
151
- net-http (0.9.1)
174
+ net-http (0.10.0)
175
+ net-protocol (>= 0.3.0)
152
176
  uri (>= 0.11.1)
177
+ net-protocol (0.4.0)
178
+ timeout
153
179
  notiffany (0.1.3)
154
180
  nenv (~> 0.1)
155
181
  shellany (~> 0.0)
156
- octokit (6.1.1)
182
+ octokit (10.0.0)
157
183
  faraday (>= 1, < 3)
158
184
  sawyer (~> 0.9)
159
185
  os (1.1.4)
@@ -164,17 +190,19 @@ GEM
164
190
  ast (~> 2.4.1)
165
191
  racc
166
192
  prism (1.9.0)
167
- pry (0.14.2)
193
+ pry (0.16.1)
168
194
  coderay (~> 1.1)
169
195
  method_source (~> 1.0)
170
- public_suffix (7.0.2)
196
+ reline (>= 0.6.0)
197
+ pstore (0.3.0)
198
+ public_suffix (7.0.5)
171
199
  racc (1.8.1)
172
200
  rainbow (3.1.1)
173
- rake (13.3.1)
201
+ rake (13.4.2)
174
202
  rb-fsevent (0.11.2)
175
203
  rb-inotify (0.11.1)
176
204
  ffi (~> 1.0)
177
- rbtree (0.4.6)
205
+ rbtree (0.4.7)
178
206
  regexp_parser (2.11.3)
179
207
  reline (0.6.3)
180
208
  io-console (~> 0.5)
@@ -214,16 +242,16 @@ GEM
214
242
  addressable (>= 2.3.5)
215
243
  faraday (>= 0.17.3, < 3)
216
244
  shellany (0.0.1)
217
- signet (0.21.0)
245
+ signet (0.22.2)
218
246
  addressable (~> 2.8)
219
247
  faraday (>= 0.17.5, < 3.a)
220
248
  jwt (>= 1.5, < 4.0)
221
- multi_json (~> 1.10)
222
249
  thor (1.5.0)
250
+ timeout (0.6.1)
223
251
  unicode-display_width (3.2.0)
224
252
  unicode-emoji (~> 4.1)
225
253
  unicode-emoji (4.2.0)
226
- uri (1.1.1)
254
+ uri (1.1.2)
227
255
 
228
256
  PLATFORMS
229
257
  aarch64-linux-gnu
@@ -244,7 +272,7 @@ DEPENDENCIES
244
272
  fuubar
245
273
  guard (~> 2.18)
246
274
  guard-rspec (~> 4.7)
247
- pry (~> 0.14.1)
275
+ pry (~> 0.16)
248
276
  rake (~> 13.0)
249
277
  rspec (~> 3.12)
250
278
  rubocop (~> 1.92)
data/README.md CHANGED
@@ -84,8 +84,11 @@ Options:
84
84
  -V, [--version], [--no-version] # Print the version and exit
85
85
  -v, [--verbose], [--no-verbose] # Increase verbosity. May be repeated for even more verbosity.
86
86
  # Default: [true]
87
+ [--dry-run], [--no-dry-run] # Validate and show what would be added without writing
87
88
  ```
88
89
 
90
+ `imt add mod` validates every entry in the file before writing any of them, and each `add` command exits 1 on failure.
91
+
89
92
  #### `imt list`
90
93
 
91
94
  ```sh
@@ -149,7 +152,7 @@ Options:
149
152
  [--force] # Let mods/tools sync delete over 25% of a collection
150
153
  ```
151
154
 
152
- **Removal**: Mod and tool authors control their own entries. If a `modinfo.json` or `toolinfo.json` is removed or renamed (so it returns HTTP 404 or 410), `imt sync mods`/`tools` deletes its entries. If a file cannot be read for any other reason (timeout, network error, server error, rate limit, or invalid JSON), that file's entries are kept on that run and a warning names them; other sources are unaffected. Sync tracks which file each entry came from in the internal `meta/mod_sources` and `meta/tool_sources` documents (override with `collections.meta.mod_sources` / `tool_sources` in the config). An entry with no recorded source yet is kept while any source fails. As a brake on a wave of 404s (a GitHub outage, a mass rename), `imt sync mods`/`tools` refuses to delete more than 25% of a collection (at least 5 entries), or to empty it, and exits 1; rerun with `--force` once you have checked the sources.
155
+ **Removal**: Mod and tool authors control their own entries. If a `modinfo.json` or `toolinfo.json` is removed or renamed (so it returns HTTP 404 or 410), `imt sync mods`/`tools` deletes its entries. If a file cannot be read for any other reason (timeout, network error, server error, rate limit, or invalid JSON), that file's entries are kept on that run and a warning names them; other sources are unaffected. Sync tracks which file each entry came from in the internal `meta/mod_sources` and `meta/tool_sources` documents (override with `collections.meta.mod_sources` / `tool_sources` in the config). An entry with no recorded source yet is kept while any source fails. As a brake on a wave of 404s (a GitHub outage, a mass rename), `imt sync mods`/`tools` refuses to delete more than 25% of a collection (at least 5 entries), or to empty it, and exits 1; rerun with `--force` once you have checked the sources. `--dry-run` lists what a real run would delete and warns if the brake would stop it.
153
156
 
154
157
  **Exit status**: each `imt sync` command exits 1 when it fails. `imt sync all` runs every stage even if one fails, then exits 1.
155
158
 
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  # Uncomment to register a new dependency of your gem
33
33
  # spec.add_dependency "example-gem", "~> 1.0"
34
- spec.add_dependency "google-cloud-firestore", "~> 2.7"
35
- spec.add_dependency "octokit", "~> 6.0"
34
+ spec.add_dependency "google-cloud-firestore", "~> 3.3"
35
+ spec.add_dependency "octokit", "~> 10.0"
36
36
  spec.add_dependency "ostruct", "~> 0.6"
37
37
  spec.add_dependency "paint", "~> 2.3"
38
38
  spec.add_dependency "thor", "~> 1.2"
@@ -268,19 +268,23 @@ module Icarus
268
268
  puts success_or_failure(response) if verbose > 1
269
269
  end
270
270
 
271
+ unless options[:dry_run]
272
+ puts "Created/Updated #{info_array.count} Items" if verbose?
273
+ sync.save_sources
274
+ end
275
+
276
+ delete_array = protect_transient_sources(sync, list_array.filter { |list| sync.find_info(list).nil? })
277
+
271
278
  if options[:dry_run]
279
+ preview_deletions(type, delete_array, list_array, info_array)
272
280
  puts Paint["Dry run; no changes will be made", :white] if verbose?
273
281
  return
274
282
  end
275
283
 
276
- puts "Created/Updated #{info_array.count} Items" if verbose?
277
- sync.save_sources
278
-
279
- delete_array = protect_transient_sources(sync, list_array.filter { |list| sync.find_info(list).nil? })
280
-
281
284
  return unless delete_array.any?
282
285
 
283
- refuse_mass_delete(type, delete_array, list_array, info_array)
286
+ raise Icarus::Mod::Tools::Error, mass_delete_message("Refusing", type, delete_array, list_array) if
287
+ mass_delete?(delete_array, list_array, info_array)
284
288
 
285
289
  puts "Deleting outdated items..." if verbose?
286
290
  delete_array.each do |list|
@@ -301,16 +305,28 @@ module Icarus
301
305
 
302
306
  # A wave of 404s (a GitHub outage, a mass rename) looks like every author removing their file, so stage 2
303
307
  # will not delete more than MASS_DELETE_RATIO of a collection, or empty it, unless run with --force
304
- def refuse_mass_delete(type, delete_array, list_array, info_array)
305
- return if options[:force]
308
+ def mass_delete?(delete_array, list_array, info_array)
309
+ return false if options[:force] || delete_array.empty?
306
310
 
307
311
  emptying = info_array.empty? && delete_array.size >= list_array.size
308
312
  too_many = delete_array.size >= MASS_DELETE_MIN && delete_array.size > list_array.size * MASS_DELETE_RATIO
309
- return unless emptying || too_many
313
+ emptying || too_many
314
+ end
315
+
316
+ def mass_delete_message(verb, type, delete_array, list_array)
317
+ Paint["#{verb} to delete #{delete_array.size} of #{list_array.size} #{type}; " \
318
+ "check the sources, then rerun with --force if this is intended", :red, :bright]
319
+ end
320
+
321
+ # What a real run would delete, and whether the mass-delete brake would stop it
322
+ def preview_deletions(type, delete_array, list_array, info_array)
323
+ return unless verbose?
324
+
325
+ puts "Would delete #{delete_array.count} outdated item(s)#{":" if delete_array.any?}"
326
+ delete_array.each { |list| puts Paint[" #{list.author || "NoOne"}/#{list.name || "Unnamed"} (#{list.id})", :yellow] }
327
+ return unless mass_delete?(delete_array, list_array, info_array)
310
328
 
311
- raise Icarus::Mod::Tools::Error,
312
- Paint["Refusing to delete #{delete_array.size} of #{list_array.size} #{type}; " \
313
- "check the sources, then rerun with --force if this is intended", :red, :bright]
329
+ warn mass_delete_message("Would refuse", type, delete_array, list_array)
314
330
  end
315
331
  end
316
332
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icarus
4
4
  module Mod
5
- VERSION = "3.0.0"
5
+ VERSION = "3.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Icarus-Mod-Tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan Young
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '2.7'
18
+ version: '3.3'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '2.7'
25
+ version: '3.3'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: octokit
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.0'
32
+ version: '10.0'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '6.0'
39
+ version: '10.0'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ostruct
42
42
  requirement: !ruby/object:Gem::Requirement