simonc-AbsoluteRenamer 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +34 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/bin/absrenamer +54 -0
- data/test/absolute_renamer_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +71 -0
data/.document
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Simon COURTOIS
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
= AbsoluteRenamer
|
2
|
+
|
3
|
+
AbsoluteRenamer is a very powerful tool that helps files and directories renaming using the Krename syntax.
|
4
|
+
|
5
|
+
= SYNOPSIS:
|
6
|
+
|
7
|
+
absrenamer[OPTION]... [FILE]...
|
8
|
+
|
9
|
+
absrenamer-f 'photo_##' -x '%' IMG*.JPG
|
10
|
+
|
11
|
+
= REQUIREMENTS:
|
12
|
+
|
13
|
+
* Ruby >= 1.8.7 (earlier releases will not work)
|
14
|
+
|
15
|
+
= INSTALL:
|
16
|
+
|
17
|
+
You can simply install AbsoluteRenamer with gem :
|
18
|
+
|
19
|
+
sudo gem install simonc-AbsoluteRenamer
|
20
|
+
|
21
|
+
== Note on Patches/Pull Requests
|
22
|
+
|
23
|
+
* Fork the project.
|
24
|
+
* Make your feature addition or bug fix.
|
25
|
+
* Add tests for it. This is important so I don't break it in a
|
26
|
+
future version unintentionally.
|
27
|
+
* Commit, do not mess with rakefile, version, or history.
|
28
|
+
(if you want to have your own version, that is fine but
|
29
|
+
bump version in a commit by itself I can ignore when I pull)
|
30
|
+
* Send me a pull request. Bonus points for topic branches.
|
31
|
+
|
32
|
+
== Copyright
|
33
|
+
|
34
|
+
Copyright (c) 2009 Simon COURTOIS. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "AbsoluteRenamer"
|
8
|
+
gem.summary = %Q{AbsoluteRenamer is a very powerful tool that helps files and directories renaming using the Krename syntax.}
|
9
|
+
gem.description = %Q{Unlike many batch renaming tools, AbsoluteRenamer is able to rename folders.
|
10
|
+
AbsoluteRenamer is modular and can be extended to adapt itself to any kind of file
|
11
|
+
or to add new options and features.}
|
12
|
+
gem.email = "happynoff@free.fr"
|
13
|
+
gem.homepage = "http://github.com/simonc/AbsoluteRenamer"
|
14
|
+
gem.authors = ["Simon COURTOIS"]
|
15
|
+
gem.add_development_dependency "thoughtbot-shoulda"
|
16
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
+
end
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'rake/testtask'
|
23
|
+
Rake::TestTask.new(:test) do |test|
|
24
|
+
test.libs << 'lib' << 'test'
|
25
|
+
test.pattern = 'test/**/*_test.rb'
|
26
|
+
test.verbose = true
|
27
|
+
end
|
28
|
+
|
29
|
+
begin
|
30
|
+
require 'rcov/rcovtask'
|
31
|
+
Rcov::RcovTask.new do |test|
|
32
|
+
test.libs << 'test'
|
33
|
+
test.pattern = 'test/**/*_test.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
rescue LoadError
|
37
|
+
task :rcov do
|
38
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task :test => :check_dependencies
|
43
|
+
|
44
|
+
task :default => :test
|
45
|
+
|
46
|
+
require 'rake/rdoctask'
|
47
|
+
Rake::RDocTask.new do |rdoc|
|
48
|
+
if File.exist?('VERSION')
|
49
|
+
version = File.read('VERSION')
|
50
|
+
else
|
51
|
+
version = ""
|
52
|
+
end
|
53
|
+
|
54
|
+
rdoc.rdoc_dir = 'rdoc'
|
55
|
+
rdoc.title = "AbsoluteRenamer #{version}"
|
56
|
+
rdoc.rdoc_files.include('README*')
|
57
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
58
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.9.1
|
data/bin/absrenamer
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#
|
4
|
+
# = Synopsis
|
5
|
+
#
|
6
|
+
# Does a batch renaming on files and directories
|
7
|
+
#
|
8
|
+
# = Usage
|
9
|
+
#
|
10
|
+
# absrenamer [options] [file]...
|
11
|
+
#
|
12
|
+
# = Description
|
13
|
+
#
|
14
|
+
# AbsoluteRenamer is a very powerful tool that helps files and directories
|
15
|
+
# renaming using the Krename syntax.
|
16
|
+
#
|
17
|
+
# It is extendable by adding new command line parsers,
|
18
|
+
# new renaming modules and plugins.
|
19
|
+
#
|
20
|
+
# Parsers allow to add new command line options.
|
21
|
+
# Modules allow to add new renaming patterns (like ID3 tags).
|
22
|
+
# Plugins allow to add new features like file listing instead of renaming.
|
23
|
+
#
|
24
|
+
# = Exemple
|
25
|
+
#
|
26
|
+
# absrenamer-f '[1;2]_[*4-]' *.mp3
|
27
|
+
# # => takes the first two characters of the original name
|
28
|
+
# # and Camelizes from the fourth to the end.
|
29
|
+
#
|
30
|
+
# = Copyright (c) 2009 Simon COURTOIS
|
31
|
+
# Licensed under the GNU Public License
|
32
|
+
|
33
|
+
$:.unshift File.dirname(__FILE__) << '/../lib'
|
34
|
+
|
35
|
+
require 'absolute_renamer'
|
36
|
+
require 'absolute_renamer/config'
|
37
|
+
require 'absolute_renamer/parser'
|
38
|
+
require 'absolute_renamer/external'
|
39
|
+
|
40
|
+
config_path = File.dirname(__FILE__)+'/../conf/absrenamer/absrenamer.conf'
|
41
|
+
config_path = '/etc/absrenamer/absrenamer.conf' if File.exists?('/etc/absrenamer/absrenamer.conf')
|
42
|
+
custom_conf = '~/.absrenamerrc'
|
43
|
+
|
44
|
+
AbsoluteRenamer::Config.load(config_path)
|
45
|
+
AbsoluteRenamer::Config.load(custom_conf) if File.exists? custom_conf
|
46
|
+
|
47
|
+
AbsoluteRenamer::Parser.parse_cmd_line
|
48
|
+
|
49
|
+
AbsoluteRenamer::External.load_modules
|
50
|
+
AbsoluteRenamer::External.load_plugins
|
51
|
+
|
52
|
+
AbsoluteRenamer::Processor.load_plugins
|
53
|
+
AbsoluteRenamer::Processor.create_names_list
|
54
|
+
AbsoluteRenamer::Processor.do_renaming
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: simonc-AbsoluteRenamer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Simon COURTOIS
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-09-21 00:00:00 -07:00
|
13
|
+
default_executable: absrenamer
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thoughtbot-shoulda
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
description: Unlike many batch renaming tools, AbsoluteRenamer is able to rename folders. AbsoluteRenamer is modular and can be extended to adapt itself to any kind of file or to add new options and features.
|
26
|
+
email: happynoff@free.fr
|
27
|
+
executables:
|
28
|
+
- absrenamer
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- LICENSE
|
33
|
+
- README.rdoc
|
34
|
+
files:
|
35
|
+
- .document
|
36
|
+
- .gitignore
|
37
|
+
- LICENSE
|
38
|
+
- README.rdoc
|
39
|
+
- Rakefile
|
40
|
+
- VERSION
|
41
|
+
- test/test_helper.rb
|
42
|
+
has_rdoc: false
|
43
|
+
homepage: http://github.com/simonc/AbsoluteRenamer
|
44
|
+
licenses:
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options:
|
47
|
+
- --charset=UTF-8
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
version:
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 1.3.5
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: AbsoluteRenamer is a very powerful tool that helps files and directories renaming using the Krename syntax.
|
69
|
+
test_files:
|
70
|
+
- test/absolute_renamer_test.rb
|
71
|
+
- test/test_helper.rb
|