diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-12-06 20:54:06 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-12-06 13:09:01 -0800 |
commit | 2c4dc76c6a4840865c83177ceeb217b859e20df8 (patch) | |
tree | 39c92ce6fdae8c90b998cf1997b74d7b937a2363 /lib/mogilefs/mogilefs.rb | |
parent | db55f4b60ccb312881d84eea8c15daf115a7f1bd (diff) | |
download | mogilefs-client-2c4dc76c6a4840865c83177ceeb217b859e20df8.tar.gz |
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r-- | lib/mogilefs/mogilefs.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb index 6059f5f..22dd39c 100644 --- a/lib/mogilefs/mogilefs.rb +++ b/lib/mogilefs/mogilefs.rb @@ -129,7 +129,7 @@ class MogileFS::MogileFS < MogileFS::Client # Consider using store_file instead of this method for large files. # This requires a block passed to it and operates like File.open. # This atomically replaces existing data stored as +key+ when - def new_file(key, args = nil, bytes = 0) # :yields: file + def new_file(key, args = nil, bytes = nil) # :yields: file raise MogileFS::ReadOnlyError if readonly? opts = { :key => key, :multi_dest => 1 } case args @@ -157,6 +157,7 @@ class MogileFS::MogileFS < MogileFS::Client opts.merge!(args) if Hash === args opts[:backend] = @backend opts[:fid] = res['fid'] + opts[:content_length] ||= bytes if bytes case (dests[0][1] rescue nil) when %r{\Ahttp://} |