media_archiver 0.0.6.1 → 0.0.7.2
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 +1 -0
- data/lib/media_archiver/cli.rb +17 -6
- data/lib/media_archiver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ee1e4c4954520e6625b43ef3b6ef00857d8421d
|
4
|
+
data.tar.gz: 29e1ee9e659e35ec580e37cd4ed719e01bb469af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa9a0f3d5b03d322730dc2692197d631c79959cfdd584e1e180ee35b29bda9ab0bbb1dc7183bca3e611b3a6b2352a09b6b2f493a973503f47d33b87f246f7d3
|
7
|
+
data.tar.gz: 970a5afee928e71f102aae166053187e229cbab8789ff0631ce22581506025a9258c6041922ca9bfbfd11ccb83ddfbfc7acc2a30e0518b33b8b72a0d935f1ab0
|
data/.gitignore
CHANGED
data/lib/media_archiver/cli.rb
CHANGED
@@ -4,13 +4,19 @@ require 'yaml'
|
|
4
4
|
|
5
5
|
module MediaArchiver
|
6
6
|
class CLI < Thor
|
7
|
+
package_name "MediaArchiver"
|
8
|
+
map "-R" => :recursive
|
9
|
+
map "-O" => :output_dir
|
10
|
+
map "-C" => :configuration_file
|
11
|
+
|
7
12
|
DEFAULT_OUTPUT_TEMPLATE = ':DateTimeOriginal/:Make/:Model'
|
8
13
|
|
9
|
-
desc 'copy [DIR]
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
desc 'copy [DIR]', 'Scans a folder and archives media files'
|
15
|
+
method_option :output_dir, aliases: :o, desc: 'Output folder where the files should be copied into'
|
16
|
+
method_option :recursive, aliases: :r, type: :boolean, default: true, desc: "Recursivelly scan input folder"
|
17
|
+
method_option :output_template
|
18
|
+
method_option :configuration_file, aliases: :c
|
19
|
+
method_option :overwrite_extensions, type: :array
|
14
20
|
def copy(path = Dir.pwd)
|
15
21
|
config = configurations(options)
|
16
22
|
|
@@ -22,7 +28,12 @@ module MediaArchiver
|
|
22
28
|
|
23
29
|
output = ["File: #{dest}"]
|
24
30
|
output << if File.exist?(dest)
|
25
|
-
|
31
|
+
if config[:overwrite_extensions].empty? || !config[:overwrite_extensions].include?(dest.split('.').last.downcase)
|
32
|
+
'[SKIP]'
|
33
|
+
else
|
34
|
+
FileUtils.cp(file.path, dest)
|
35
|
+
'[OVERWRITE]'
|
36
|
+
end
|
26
37
|
else
|
27
38
|
FileUtils.cp(file.path, dest)
|
28
39
|
'[OK]'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: media_archiver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Ramalho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|