PathExpander helps pre-process command-line arguments expanding directories into their constituent files. It further helps by providing additional mechanisms to make specifying subsets easier with path subtraction and allowing for command-line arguments to be saved in a file.
NOTE: this is NOT an options processor. It is a path processor (basically everything else besides options). It does provide a mechanism for pre-filtering cmdline options, but not with the intent of actually processing them in PathExpander. Use OptionParser to deal with options either before or after passing ARGV through PathExpander.
class MyPathExpander < PathExpander MY_GLOB = "**/*.rb" def initialize args = ARGV super args, MY_GLOB end end MyPathExpander.new(ARGV, my_glob).process.each do |f| # do something with each file end
gem install path_expanderIf you want to hack on path_expander, clone it from GitHub:
git clone git://github.com/seattlerb/path_expander