Skip to content

Instantly share code, notes, and snippets.

@bgentry
Created March 10, 2011 22:11
Show Gist options
  • Save bgentry/865037 to your computer and use it in GitHub Desktop.
Save bgentry/865037 to your computer and use it in GitHub Desktop.
Dir.glob_without
class Dir
def self.glob_without(pattern, regexp, directory = pwd)
chdir(directory) do
glob(pattern).reject {|i| i =~ regexp }.map {|i| File.expand_path(i) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment