Skip to content

Quacks like a Regexp, tastes like your shell's a file glob.

Notifications You must be signed in to change notification settings

adamsanderson/file_glob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FileGlob

Quacks like a Regexp, tastes like Dir.glob.

Use FileGlob in place of a Regexp when shell pattern matching makes more sense.

Usage

Filter a set of file paths:

glob = FileGlob.new("test/**/*_test.rb")
paths.select{|path| path =~ glob }

Perform different actions for different file types:

image = FileGlob.new("*.{png,jpg,gif}")
text  = FileGlob.new("*.txt")

case path
when image then process_image(path)
when text  then process_text(path)
end

Installation

Install with rubygems:

gem install file_glob

Adam Sanderson, http://www.monkeyandcrow.com

About

Quacks like a Regexp, tastes like your shell's a file glob.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages