From ccd46828c69e8bb57a2814e39b54477ed0e48fb6 Mon Sep 17 00:00:00 2001 From: 404 Date: Fri, 29 Jun 2012 11:45:42 +0800 Subject: [PATCH] fixed raise NoSuchFileError bug. #3 --- Gemfile.lock | 2 +- lib/qiniu/rs/io.rb | 2 +- lib/qiniu/rs/version.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 504b2b6..d28949b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - qiniu-rs (2.0.4) + qiniu-rs (2.0.5) json (~> 1.7.3) mime-types (~> 1.19) rest-client (~> 1.6.7) diff --git a/lib/qiniu/rs/io.rb b/lib/qiniu/rs/io.rb index 8e2768a..fbc0499 100755 --- a/lib/qiniu/rs/io.rb +++ b/lib/qiniu/rs/io.rb @@ -21,7 +21,7 @@ module Qiniu end def put_file(url, local_file, bucket = nil, key = nil, mime_type = nil, custom_meta = nil, callback_params = nil, enable_crc32_check = false) - raise NoSuchFileError unless File.exist?(local_file) + raise NoSuchFileError, local_file unless File.exist?(local_file) key = Digest::SHA1.hexdigest(local_file + Time.now.to_s) if key.nil? entry_uri = bucket + ':' + key if mime_type.nil? diff --git a/lib/qiniu/rs/version.rb b/lib/qiniu/rs/version.rb index 1ea6a64..2319bbd 100755 --- a/lib/qiniu/rs/version.rb +++ b/lib/qiniu/rs/version.rb @@ -2,6 +2,6 @@ module Qiniu module RS - VERSION = "2.0.4" + VERSION = "2.0.5" end end