razel 0.2.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.
- data/README.md +18 -0
- data/bin/razel +41 -0
- data/config.yaml +2 -0
- metadata +67 -0
data/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Razel
|
2
|
+
|
3
|
+
Clean up your messy drop boxes.
|
4
|
+
|
5
|
+
I liked the watch functionality of Hazel [[http://www.noodlesoft.com/hazel.php]]
|
6
|
+
and how I could use it to keep my download folder or desktop clean.
|
7
|
+
|
8
|
+
What I didn't like:
|
9
|
+
|
10
|
+
* I hardly use 10% of its functionality but it has a $21 price tag
|
11
|
+
* It moved into the system settings and into the background tasks
|
12
|
+
|
13
|
+
So, just give `razel.rb` a try.
|
14
|
+
Configure the folders you want to cleanup up, run and enjoy.
|
15
|
+
Razel just moves every file into a folder with the extension name.
|
16
|
+
Nothing more.
|
17
|
+
|
18
|
+
Oh, yeah: It probably has bugs.
|
data/bin/razel
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
# Just a little helper to clean up folders
|
7
|
+
|
8
|
+
# default config
|
9
|
+
config = {"folders" => []}
|
10
|
+
|
11
|
+
# optional config file
|
12
|
+
configfile = File.expand_path(File.dirname(__FILE__)) + '/config.yaml'
|
13
|
+
config = YAML.load_file(configfile) if File.exists?(configfile)
|
14
|
+
|
15
|
+
# command line arguments
|
16
|
+
if ARGV.empty?
|
17
|
+
folders = config['folders']
|
18
|
+
else
|
19
|
+
folders = ARGV.collect do |rel|
|
20
|
+
File.absolute_path(rel)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
folders.each do |folder|
|
25
|
+
Dir.foreach(folder) do |file|
|
26
|
+
FileUtils.cd(folder)
|
27
|
+
|
28
|
+
itsnotme = File.basename(__FILE__) != File.basename(file)
|
29
|
+
|
30
|
+
if File.file?(file) && itsnotme
|
31
|
+
ext = File.extname(file).downcase
|
32
|
+
ext.slice!(0)
|
33
|
+
unless ext.empty?
|
34
|
+
target_dir = "#{folder}/Razel/#{ext}"
|
35
|
+
FileUtils.mkdir_p(target_dir) unless Dir.exists?(target_dir)
|
36
|
+
FileUtils.move(file, "#{target_dir}/#{file}")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
data/config.yaml
ADDED
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: razel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 2
|
9
|
+
version: 0.2.2
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Sebastian Schulze
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-05-29 00:00:00 +02:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Razel cleans up your messy Download and Desktop folders and sorts them by file extension
|
22
|
+
email:
|
23
|
+
- github.com@bascht.com
|
24
|
+
executables:
|
25
|
+
- razel
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- README.md
|
30
|
+
files:
|
31
|
+
- README.md
|
32
|
+
- bin/razel
|
33
|
+
- config.yaml
|
34
|
+
has_rdoc: true
|
35
|
+
homepage: http://github.com/bascht/Razel
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
segments:
|
49
|
+
- 0
|
50
|
+
version: "0"
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.3.7
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: Little Hazel-Like Tool. Sort of.
|
66
|
+
test_files: []
|
67
|
+
|