organize_files 1.0.0 → 1.0.1
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/bin/organize_files +28 -0
- data/lib/organize_files/version.rb +1 -1
- data/organize_files.gemspec +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a80eef64a9a78e625473f27a02d2db8cc3bd8cd8f4230e551b7c7d33ef82b3c2
|
4
|
+
data.tar.gz: 55fd3aff5c13ba73fd907c2c64f3802836ca660dbb3ddb9fc4be185e0a3ef01a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94788ec0ac6f4784d6a5ee30cd35f658de5d58c2bbadf8fe4d7a987af2424394bdc4cfe7bb832f4460b269d4a25187df460560cc5c74ee48105158c54bccceb9
|
7
|
+
data.tar.gz: 50e785e9682b4f665a8cf52bb141ed0b7fe8f427b24f3f8d919d72cb4cc5bc3f6cb8f35f2afaef7a8afa45c0b43080742c99cd9c098fba9a1ad7e62d9f59f78e
|
data/bin/organize_files
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'organize_files'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
OptionParser.new do |opts|
|
8
|
+
opts.banner = 'Usage: organize_files [options]'
|
9
|
+
|
10
|
+
opts.on('-d', '--directory DIRECTORY', 'Directory to organize') do |directory|
|
11
|
+
options[:directory] = directory
|
12
|
+
end
|
13
|
+
|
14
|
+
opts.on('-h', '--help', 'Prints this help') do
|
15
|
+
puts opts
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
end.parse!
|
19
|
+
|
20
|
+
if options[:directory].nil?
|
21
|
+
puts 'You must specify a directory to organize'
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
|
25
|
+
sorter = OrganizeFiles::Organizer.new(options[:directory])
|
26
|
+
sorter.organize
|
27
|
+
|
28
|
+
puts "Files in '#{options[:directory]}' have been organized"
|
data/organize_files.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: organize_files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mayank Agnihotri
|
@@ -26,7 +26,8 @@ dependencies:
|
|
26
26
|
version: '1.68'
|
27
27
|
description:
|
28
28
|
email:
|
29
|
-
executables:
|
29
|
+
executables:
|
30
|
+
- organize_files
|
30
31
|
extensions: []
|
31
32
|
extra_rdoc_files:
|
32
33
|
- README.md
|
@@ -35,6 +36,7 @@ files:
|
|
35
36
|
- Gemfile
|
36
37
|
- LICENSE
|
37
38
|
- README.md
|
39
|
+
- bin/organize_files
|
38
40
|
- lib/organize_files.rb
|
39
41
|
- lib/organize_files/file_handler.rb
|
40
42
|
- lib/organize_files/file_sorter.rb
|