metaclean 4.2.0 → 4.3.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: 8e4ebafb7621f428c5a0d0040c2487340e2dd22b32b831bf47c957027e4d0ca9
4
- data.tar.gz: e9420536e480b319833996372e9d679285289e5afdfe3555466ff8167ebf5d7f
3
+ metadata.gz: 692205ff836f71791a36b778a68d0118971b6b96e7e0be2ba00502db47cefb75
4
+ data.tar.gz: 8166979b18262baff9ecda5a7a51c12a49831c2003f45f6182684e19f7fd64bc
5
5
  SHA512:
6
- metadata.gz: 6c9b8b897058f4b86d9691d53f80f1045d78f1783861048591f6910b92cfca25a1f0e7ee531a91d22144ebf294c1240a4dd46a465412cff7c1d3dcd85d421a4f
7
- data.tar.gz: 5dcdfbd96dd879ddb8c6e86f2c48b29ac43672eb5636ea2fb5e2a3260cac0bf9bad7644bb594d05834e1267850d95034ff3b4780b5a54af9e60b6cc321ea47fd
6
+ metadata.gz: e631299143c75e723d62eb37fa2674a0ffa1d9a81bf96f8947c0880344744741c041eca28deaeaefaaeafc23961a5503731a62a859a7bbf544ea4fdd94ef623a
7
+ data.tar.gz: 2e90e6758bf445f6a3468f2c012a3c0d4f3724f5846ca87068ccdd4d5c5362079aa7682cdb68a0c216b489ad9b20b5db0a1df2d3a006bb3c9523d6f2ef787ac0
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # metaclean
2
2
 
3
- ```
3
+ ```text
4
4
  ███╗ ███╗███████╗████████╗ █████╗ ██████╗██╗ ███████╗ █████╗ ███╗ ██╗
5
5
  ████╗ ████║██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔════╝██╔══██╗████╗ ██║
6
6
  ██╔████╔██║█████╗ ██║ ███████║██║ ██║ █████╗ ███████║██╔██╗ ██║
@@ -253,6 +253,9 @@ git push origin vX.Y.Z
253
253
  unverified candidates all exit non-zero.
254
254
  - When stdout is redirected, metadata values are redacted by default. Use
255
255
  `--show-values` only when the destination log is trusted.
256
+ - Warnings and errors are written to stderr, so privacy notes (surviving tags,
257
+ the `.bak` reminder) stay visible even when normal output is piped or sent
258
+ to a file.
256
259
  - External tool versions are recorded in CI and shown by `metaclean --version`.
257
260
  Keep OS packages updated; release tests exercise the supported Ruby range and
258
261
  capability-check qpdf/ffmpeg output rather than trusting version strings.
data/lib/metaclean/cli.rb CHANGED
@@ -104,8 +104,8 @@ module Metaclean
104
104
 
105
105
  o.separator ''
106
106
  o.separator 'Other:'
107
- o.on('-h', '--help') { Display.banner; puts o; exit }
108
- o.on('-v', '--version') do
107
+ o.on('-h', '--help', 'Show this help and exit') { Display.banner; puts o; exit }
108
+ o.on('-v', '--version', 'Show metaclean and tool versions, then exit') do
109
109
  Display.banner
110
110
  puts "metaclean #{Metaclean::VERSION}"
111
111
  puts " exiftool: #{Display.printable(Exiftool.version || 'not found')}"
@@ -43,10 +43,13 @@ module Metaclean
43
43
  def color?
44
44
  return @color if defined?(@color)
45
45
 
46
- no_color = ENV['NO_COLOR'].to_s
47
- @color = $stdout.tty? && no_color.empty?
48
- @color = true if ENV['FORCE_COLOR']
49
- @color
46
+ @color = if !ENV['NO_COLOR'].to_s.empty?
47
+ false
48
+ elsif !ENV['FORCE_COLOR'].to_s.empty?
49
+ true
50
+ else
51
+ $stdout.tty?
52
+ end
50
53
  end
51
54
 
52
55
  def c(text, color)
@@ -73,7 +76,7 @@ module Metaclean
73
76
  def section(text); puts c("▸ #{text}", :cyan) unless quiet?; end
74
77
  def info(text); puts c(" #{text}", :gray) unless quiet?; end
75
78
  def success(text); puts c("✓ #{text}", :green) unless quiet?; end
76
- def warning(text); puts c("⚠ #{text}", :yellow);end
79
+ def warning(text); warn c("⚠ #{text}", :yellow);end
77
80
 
78
81
  def error(text); c("✗ #{text}", :red); end
79
82
 
@@ -159,9 +159,12 @@ module Metaclean
159
159
  Display.warning "Privacy-relevant tags still present (#{residual.size}):"
160
160
  unless Display.quiet?
161
161
  residual.each do |key, value|
162
- puts " #{Display.c(key, :yellow)} = #{Display.truncate(Display.visible_value(value), 60)}"
162
+ warn " #{Display.c(key, :yellow)} = #{Display.truncate(Display.visible_value(value), 60)}"
163
163
  end
164
164
  end
165
+ if residual.keys.all? { |key| key.to_s.start_with?('ICC') }
166
+ Display.warning 'Only ICC profile text remains — review it and pass --allow-icc-metadata to accept it.'
167
+ end
165
168
  residual
166
169
  end
167
170
 
@@ -296,7 +299,7 @@ module Metaclean
296
299
  if summary[:unsupported].positive?
297
300
  Display.warning "Unsupported (not cleaned): #{summary[:unsupported]} file(s)"
298
301
  end
299
- puts Display.error("Failed: #{summary[:failed]}") if summary[:failed].positive?
302
+ warn Display.error("Failed: #{summary[:failed]}") if summary[:failed].positive?
300
303
  Display.info "Total embedded tags removed: #{summary[:removed_total]}"
301
304
  if summary[:residual_files].positive?
302
305
  Display.warning "Files with privacy residual: #{summary[:residual_files]}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Metaclean
4
- VERSION = '4.2.0'
4
+ VERSION = '4.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metaclean
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Zogaj
@@ -42,6 +42,7 @@ licenses:
42
42
  metadata:
43
43
  allowed_push_host: https://rubygems.org
44
44
  bug_tracker_uri: https://github.com/26zl/metaclean/issues
45
+ changelog_uri: https://github.com/26zl/metaclean/releases
45
46
  documentation_uri: https://github.com/26zl/metaclean#readme
46
47
  source_code_uri: https://github.com/26zl/metaclean
47
48
  rubygems_mfa_required: 'true'