Open
Conversation
Contributor
|
@mjason 感谢你的重构,还烦请增加以下测试用例:
|
|
|
||
| attr_accessor :api_secret, :bucket, :password, :params | ||
| alias_method :api_secret, :password | ||
| alias_method :password, :api_secret |
Contributor
There was a problem hiding this comment.
@mjason 抱歉看懂这里调整的目的是?另外 commit 信息不准确吧 from password -> form password ?
Author
|
commit 忘记合并了,这个是因为alias_method :password, :api_secret,保证兼容你form的接口 |
Contributor
|
commit 麻烦 rebase 一下,还有 commit 信息麻烦请遵守 sparanoid/chinese-copywriting-guidelines: Chinese Copywriting Guidelines / 中文文案排版指北, 中英文之间请加上空格 |
Author
Upyun::FormBase.new api_secret: Rails.configuration.upyun[:form],
bucket: Rails.configuration.upyun[:bucket],
params: {
'save-key' => "/{year}_{mon}_{day}_{filename}{.suffix}"
}提取出base 之后可以更加直观使用api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
form 这个代码设计有点问题,重构了一下
分离出签名部分,让开发者可以直接获取到signature和policy