media_archiver 0.0.2 → 0.0.3
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/README.md +29 -10
- data/lib/media_archiver/cli.rb +0 -1
- data/lib/media_archiver/media_file_utils.rb +11 -7
- data/lib/media_archiver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62eeb44c05bb40fd6c54cb66d830cd5282228ac8
|
4
|
+
data.tar.gz: 5c3c96acf6341444071a901fd0c576ed28b7e163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a921bd3cd1e73e23a32cdc08dd6ce65c19eac0bcbb5aee7c57f961a43d2ab17fb722032b672f6bc6d5a4daa8128763bd30b62eb48a7384474051c3ac46d476b3
|
7
|
+
data.tar.gz: 53665d79d0797b7d68e1b1fd8fc4f1554f8f14da21e34ecb396bcdb228d7d23af1309c2bdd2ea4c62ad522ad3dd6f56b3041fd85112039a4f48f9d5d2462b8b2
|
data/README.md
CHANGED
@@ -9,29 +9,48 @@ another location.
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
|
12
|
+
### MAC OS X
|
13
13
|
|
14
|
-
|
15
|
-
gem 'media_archiver'
|
16
|
-
```
|
14
|
+
You need `exiftool` to use this command. Simply do:
|
17
15
|
|
18
|
-
|
16
|
+
```bash
|
17
|
+
brew install exiftool
|
18
|
+
```
|
19
19
|
|
20
|
-
|
20
|
+
Then install the gem
|
21
21
|
|
22
|
-
|
22
|
+
```bash
|
23
|
+
gem install media_archiver
|
24
|
+
```
|
23
25
|
|
24
|
-
|
26
|
+
and you're done
|
25
27
|
|
26
28
|
## Usage
|
27
29
|
|
28
30
|
run `media_archiver` from the command line
|
29
31
|
|
30
|
-
```
|
32
|
+
```bash
|
31
33
|
Commands:
|
32
34
|
media_archiver copy [DIR] [OUTPUT_DIR] # Scans a folder and archives media files
|
33
35
|
media_archiver help [COMMAND] # Describe available commands or one specific command
|
34
|
-
|
36
|
+
```
|
37
|
+
|
38
|
+
## Configuration
|
39
|
+
|
40
|
+
Apart from the options you can set when running individual commands, the script will look for a `.media_archiver_conf.yml` file both in the current folder and on you home folder.
|
41
|
+
|
42
|
+
Configurations are prioritized like:
|
43
|
+
|
44
|
+
1. CLI options
|
45
|
+
1. Current folder configuration file
|
46
|
+
1. Home folder configuration file
|
47
|
+
|
48
|
+
|
49
|
+
```yaml
|
50
|
+
---
|
51
|
+
output_dir: ~/photos
|
52
|
+
recursive: true
|
53
|
+
output_template: :date_created/:make/:model
|
35
54
|
```
|
36
55
|
|
37
56
|
## Contributing
|
data/lib/media_archiver/cli.rb
CHANGED
@@ -5,13 +5,7 @@ module MediaArchiver
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def each(recursive)
|
8
|
-
|
9
|
-
Dir.glob(File.join(@path, '**', '*'))
|
10
|
-
else
|
11
|
-
Dir.glob(File.join(@path, '*'))
|
12
|
-
end
|
13
|
-
|
14
|
-
files
|
8
|
+
scan_path(recursive)
|
15
9
|
.reject { |path| File.directory? path }
|
16
10
|
.each_with_object([]) do |file_path, acc|
|
17
11
|
file = MediaFile.new(file_path)
|
@@ -22,5 +16,15 @@ module MediaArchiver
|
|
22
16
|
end
|
23
17
|
end
|
24
18
|
end
|
19
|
+
|
20
|
+
protected
|
21
|
+
|
22
|
+
def scan_path(recursive)
|
23
|
+
if recursive
|
24
|
+
Dir.glob(File.join(@path, '**', '*'))
|
25
|
+
else
|
26
|
+
Dir.glob(File.join(@path, '*'))
|
27
|
+
end
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|