Sha256: 329910a1e8d0a2339c6aea8dd6e7edcea3b1a594a660c3d13427eb011a98c32c

Contents?: true

Size: 1.66 KB

Versions: 1

Compression:

Stored size: 1.66 KB

Contents

#!/usr/bin/env ruby187

#
# = Synopsis
#
# Does a batch renaming on files and directories
#
# = Usage
#
# absrenamer [options] [file]...
#
# = Description
#
# AbsoluteRenamer is a very powerful tool that helps files and directories
# renaming using the Krename syntax.
#
# It is extendable by adding new command line parsers,
# new renaming modules and plugins.
#
# Parsers allow to add new command line options.
# Modules allow to add new renaming patterns (like ID3 tags).
# Plugins allow to add new features like file listing instead of renaming.
#
# = Exemple
#
#   absrenamer-f '[1;2]_[*4-]' *.mp3
#   # => takes the first two characters of the original name
#   #    and Camelizes from the fourth to the end.
#
# = Copyright (c) 2009 Simon COURTOIS
# Licensed under the GNU Public License

# Checking the ruby version.
unless RUBY_VERSION >= "1.8.7"
  $stderr.puts "AbsoluteRenamer must be used with Ruby >= 1.8.7"
  exit 1
end

$:.unshift File.dirname(__FILE__) << '/../lib'

require 'absolute_renamer'
require 'absolute_renamer/config'
require 'absolute_renamer/parser'
require 'absolute_renamer/external'

config_path = File.dirname(__FILE__)+'/../conf/absrenamer/absrenamer.conf'
global_conf = '/etc/absrenamer/absrenamer.conf'
custom_conf = '~/.absrenamerrc'

AbsoluteRenamer::Config.load(config_path)
AbsoluteRenamer::Config.load(global_conf) if File.exists? global_conf
AbsoluteRenamer::Config.load(custom_conf) if File.exists? custom_conf

AbsoluteRenamer::Parser.parse_cmd_line

AbsoluteRenamer::External.load_modules
AbsoluteRenamer::External.load_plugins

AbsoluteRenamer::Processor.load_plugins
AbsoluteRenamer::Processor.create_names_list
AbsoluteRenamer::Processor.do_renaming

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
AbsoluteRenamer-0.10.0 bin/absrenamer