photein 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: 5404ec50b0c5a57144fea72eff5639ca90a19a46be319cb8ee634d9f67291617
4
- data.tar.gz: bce672716a27ea28f9d4203e1858affa8793a11b5ca94e3642c6d86399969680
3
+ metadata.gz: d67c47b483c2b3525960fa4aa80221a2143b7b4bf92d67e74622ffe3ecbcf40f
4
+ data.tar.gz: 215db5531f34667eab5bd8524a51c9497697e6bb56acf8ccac51acca94aa19ce
5
5
  SHA512:
6
- metadata.gz: f11aba53e3bcdef67a150a549da7c16c45e0350b4bbdcfb4f1d1ce4c0fd778185845ef4719857e9eea4b1c15894578ae4e1b361952da3961c77fb1b0cc56c0bb
7
- data.tar.gz: 2967ccf17b7d7631325ff9b18e445b052a52db8ddec3043cc0b4b15945b0b0c0bba52f0862044f554067950b578447235771abd1d97103346492ba6de821029a
6
+ metadata.gz: 356351ee9bdb21340d47b57c12bc11857e774f8a81741f4aa2567b60555d8adc290daad8ddaea9a3ee9d48197b0a3e923fd6e2f6eaea67ef00ca51112e5895b1
7
+ data.tar.gz: f24b64e2a9faafd6ba95e85b7c3e198bc526e4f8dc216fc71e1dfab9ea3e1affacac3b8ce472b880202b13899abb98eb758504c06045380aa4e0c0ceeaa0b293
@@ -25,10 +25,14 @@ module Photein
25
25
  .map { |option| option[/\w[a-z\-]+/] }
26
26
  .map(&:to_sym)
27
27
 
28
+ @params = {}
29
+
28
30
  class << self
29
- def parse_opts!
30
- @params = {}
31
+ def set(**params)
32
+ @params.replace(params).freeze
33
+ end
31
34
 
35
+ def parse_opts!
32
36
  parser = OptionParser.new do |opts|
33
37
  opts.version = Photein::VERSION
34
38
  opts.banner = <<~BANNER
@@ -120,7 +120,7 @@ module Photein
120
120
  when 1 # if one file found, WITH OR WITHOUT COUNTER, reset counter to a
121
121
  if Dir[collision_glob].first != collision_glob.sub('*', 'a') # don't try if it's already a lone, correctly-countered file
122
122
  Photein::Logger.info('conflicting timestamp found; adding counter to existing file')
123
- FileUtils.mv(Dir[collision_glob].first, collision_glob.sub('*', 'a'))
123
+ FileUtils.mv(Dir[collision_glob].first, collision_glob.sub('*', 'a'), noop: Photein::Config.dry_run)
124
124
  end
125
125
  else # TODO: if multiple files found, rectify them?
126
126
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Photein
4
- VERSION = '0.0.6'
4
+ VERSION = '0.0.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photein
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
  - Ryan Lue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-23 00:00:00.000000000 Z
11
+ date: 2021-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mediainfo