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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bf98fe1a230a8739e15d6ce7e0e6ba85c26dc4e
4
- data.tar.gz: bc59949f9ffd0c88dd9a08825dd2afe3cac40454
3
+ metadata.gz: 62eeb44c05bb40fd6c54cb66d830cd5282228ac8
4
+ data.tar.gz: 5c3c96acf6341444071a901fd0c576ed28b7e163
5
5
  SHA512:
6
- metadata.gz: 6ed3b3659ea11f12738acd1c2801976ecc0ac882b92db292467a05adacb2f886de3886fe519a6671e3338e8415df5c6296ae7240accc4eab64384e6b5aa9df13
7
- data.tar.gz: d70c26ba63bc1f9a1239d604766c1bea4da6637705ae59395a89a28e22b4c4cbe4859736c7e3623900d33e9217ca06678a278563a60ac4f78342ba2f4bcbbaff
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
- Add this line to your application's Gemfile:
12
+ ### MAC OS X
13
13
 
14
- ```ruby
15
- gem 'media_archiver'
16
- ```
14
+ You need `exiftool` to use this command. Simply do:
17
15
 
18
- And then execute:
16
+ ```bash
17
+ brew install exiftool
18
+ ```
19
19
 
20
- $ bundle
20
+ Then install the gem
21
21
 
22
- Or install it yourself as:
22
+ ```bash
23
+ gem install media_archiver
24
+ ```
23
25
 
24
- $ gem install media_archiver
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
- media_archiver scan [PATH] # Scans a folder for media files and returns info
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
@@ -1,6 +1,5 @@
1
1
  require 'thor'
2
2
  require 'mini_exiftool'
3
- require 'byebug'
4
3
  require 'yaml'
5
4
 
6
5
  module MediaArchiver
@@ -5,13 +5,7 @@ module MediaArchiver
5
5
  end
6
6
 
7
7
  def each(recursive)
8
- files = if recursive
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
@@ -1,3 +1,3 @@
1
1
  module MediaArchiver
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_archiver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ramalho