Added CruxUtils::Port.find. Patch by Rene Lengwinat.
[ruby-cruxutils.git] / lib / cruxutils / port.rb
index ecc111334e176af841b283efe5fcd8ada0033f0f..a1e839f66bcd3273ea8c72838ff52d8507c98191 100644 (file)
@@ -20,6 +20,13 @@ class Port
                tmp
        end
 
+       def Port.find(pattern)
+               PORTDIRS.inject([]) do |memo, pd|
+                       tmp = Dir["#{pd}/#{pattern}"].map { |d| Port.new(d) }
+                       memo.concat(tmp)
+               end
+       end
+
        def initialize(dir)
                @dir = dir