-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: master
Are you sure you want to change the base?
Conversation
@mjason 感谢你的重构,还烦请增加以下测试用例:
|
@@ -32,7 +32,7 @@ class FormBase | |||
) | |||
|
|||
attr_accessor :api_secret, :bucket, :password, :params | |||
alias_method :api_secret, :password | |||
alias_method :password, :api_secret |
There was a problem hiding this comment.
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
?
commit 忘记合并了,这个是因为alias_method :password, :api_secret,保证兼容你form的接口 |
commit 麻烦 rebase 一下,还有 commit 信息麻烦请遵守 sparanoid/chinese-copywriting-guidelines: Chinese Copywriting Guidelines / 中文文案排版指北, 中英文之间请加上空格 |
Upyun::FormBase.new api_secret: Rails.configuration.upyun[:form],
bucket: Rails.configuration.upyun[:bucket],
params: {
'save-key' => "/{year}_{mon}_{day}_{filename}{.suffix}"
} 提取出base 之后可以更加直观使用api |
form 这个代码设计有点问题,重构了一下
分离出签名部分,让开发者可以直接获取到signature和policy