Skip to content

Commit

Permalink
Bump version to 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa committed Nov 30, 2014
1 parent 6ace9ca commit 8e8bf93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## CHANGE LOG

### v1.0.4
- 修正上传的参数为文件内容或者是文件描述符
- ActiveSupport 的依赖放宽到 3.2.8 或以上

### v1.0.3
- 请求失败时返回的 Hash 中增加 `:request_id` 字段;
- 对于图片空间,上传时返回的 Hash 中包含图片详情信息;
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
`Gemfile` 中加入以下代码

```ruby
gem 'upyun', '~> 1.0.3'
gem 'upyun', '~> 1.0.4'
```

然后执行如下命令安装:
Expand Down Expand Up @@ -74,12 +74,13 @@ upyun.endpoint = Upyun::ED_CMCC
> 这种方式只指定了又拍云必选的 `Date`, `Content-Length` 两个 Header,其它 Header 信息均未指定
```ruby
upyun.put('/save/to/path', 'file or binary')
upyun.put('/save/to/path', File.new('file.txt', 'rb')) # 上传一个文件
upyun.put('/save/to/path', 'binary') # 直接上传内容
```
**参数**

* `/save/to/path`: 文件在 UPYUN 空间的保存路径
* `file or binary`本地文件路径或文件内容
* `file or binary`已打开的文件描述符或文件内容,如果为文件描述符,在上传结束后该描述符会自动关闭

##### 自定义方式
您也可以选择使用 API 允许的额外可选 HTTP Header 参数,以使用 API 提供的预处理等功能:
Expand Down Expand Up @@ -260,8 +261,10 @@ upyun.endpoint = Upyun::ED_CMCC
> 使用简化版本,将不使用额外的策略参数:
```ruby
upyun.upload('file')
upyun.upload('filepath.png')
upyun.upload(File.new('filepath.png'))
```
参数可以是文件路径或者已经打开的文件文件描述符

**返回**
上传结果返回一个 `Hash` 结构:
Expand Down
2 changes: 1 addition & 1 deletion lib/upyun/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Upyun
VERSION = "1.0.3"
VERSION = "1.0.4"
end

0 comments on commit 8e8bf93

Please sign in to comment.