about summary refs log tree commit homepage
path: root/lib/mogilefs/mogilefs.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-03-24 23:02:14 -0700
committerEric Wong <normalperson@yhbt.net>2009-03-24 23:02:14 -0700
commit40e82ab559dee657a5884c77a46e85613856c9d8 (patch)
tree7a0c1bff04083d938b40ed57c85d58bae3776066 /lib/mogilefs/mogilefs.rb
parent65f9a224dfda3ac8b0ee9290b456d23ece32a053 (diff)
downloadmogilefs-client-40e82ab559dee657a5884c77a46e85613856c9d8.tar.gz
This is just like get_paths, but integrates better into Ruby
applications that use the parsed-out URI to do operations
directly on the URIs.
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r--lib/mogilefs/mogilefs.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb
index 5e20ee7..390e354 100644
--- a/lib/mogilefs/mogilefs.rb
+++ b/lib/mogilefs/mogilefs.rb
@@ -86,6 +86,13 @@ class MogileFS::MogileFS < MogileFS::Client
   end
 
   ##
+  # Get the URIs for +key+.
+
+  def get_uris(key, noverify = true, zone = nil)
+    get_paths(key, noverify, zone).map { |path| URI.parse(path) }
+  end
+
+  ##
   # Creates a new file +key+ in +klass+.  +bytes+ is currently unused.
   #
   # The +block+ operates like File.open.