Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重构 Upyun::Form #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

重构 Upyun::Form #8

wants to merge 3 commits into from

Conversation

mjason
Copy link

@mjason mjason commented Jul 22, 2016

form 这个代码设计有点问题,重构了一下

分离出签名部分,让开发者可以直接获取到signature和policy

@jsvisa
Copy link
Contributor

jsvisa commented Jul 26, 2016

@mjason 感谢你的重构,还烦请增加以下测试用例:

  1. FormBase 模块

@@ -32,7 +32,7 @@ class FormBase
)

attr_accessor :api_secret, :bucket, :password, :params
alias_method :api_secret, :password
alias_method :password, :api_secret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjason 抱歉看懂这里调整的目的是?另外 commit 信息不准确吧 from password -> form password ?

@mjason
Copy link
Author

mjason commented Jul 26, 2016

commit 忘记合并了,这个是因为alias_method :password, :api_secret,保证兼容你form的接口

@jsvisa
Copy link
Contributor

jsvisa commented Jul 26, 2016

commit 麻烦 rebase 一下,还有 commit 信息麻烦请遵守 sparanoid/chinese-copywriting-guidelines: Chinese Copywriting Guidelines / 中文文案排版指北, 中英文之间请加上空格

@mjason
Copy link
Author

mjason commented Jul 26, 2016

Upyun::FormBase.new api_secret: Rails.configuration.upyun[:form],
                        bucket: Rails.configuration.upyun[:bucket],
                        params: {
                          'save-key' => "/{year}_{mon}_{day}_{filename}{.suffix}"
                        }

提取出base 之后可以更加直观使用api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants