Skip to content

Commit

Permalink
Change Pairtree::Obj#glob implementation to be more consistent with D…
Browse files Browse the repository at this point in the history
…ir#glob
  • Loading branch information
mbklein committed Jun 10, 2011
1 parent 770be07 commit e4aca82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pairtree/obj.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def each &block
end

def glob(string, flags = 0)
entries.select { |entry| File.fnmatch(string, entry, flags) }
result = Dir.glob(File.join(self.path, string), flags) - ['.','..']
result.collect { |f| f.sub(%r{^#{self.path}/},'') }
end

def [](string)
Expand Down

0 comments on commit e4aca82

Please sign in to comment.