-
Notifications
You must be signed in to change notification settings - Fork 1
Add optional metadata #2
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
base: master
Are you sure you want to change the base?
Conversation
Add the ability to add optional metadata.
|
@rickhewes and just a small hint: don't use ambiguous commit messages, if you fix a typo just write it in the commit message :) |
|
Everything else looks good, I will merge your PR this week if you fix the issues |
|
I changed the commit message. What else would you like changing? I don't see your comments anywhere.... |
lib/tus/client.rb
Outdated
| raise 'New file uploading is not supported!' | ||
| end | ||
|
|
||
| if metadata.nil? then |
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.
Don't use trailing then unless you are writing a one-liner.
The most common way to write such statements is metadata ||= {}
lib/tus/client.rb
Outdated
| metadata[:filename] = file_name | ||
|
|
||
| pairs = [] | ||
| metadata.each do |key, value| |
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.
It is easier to use a brace-delimited block and place this code right at the request construction. Thus you will not need pairs (which is also a bad name choice too)
|
Sorry, forgot to publish the review :) |
|
@rickhewes , looks nice! I will merge your PR and release a new version in a few days |
|
@factyy I have another addition re CHUNK_SIZE. Maybe hold off releasing another version. Let me get the pull request going. |
|
Ok, lets do it this way |
Add the ability to add optional metadata.