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

Add PATCH support #134

Merged
merged 6 commits into from
Oct 14, 2016
Merged

Add PATCH support #134

merged 6 commits into from
Oct 14, 2016

Conversation

hernangonzalez
Copy link
Contributor

Hi,

Added support to PATCH methods that I use in my projects. Let me know if anything needs a change.

Thanks,
H.

@devluckybot
Copy link

1 Error
🚫 Any changes to library code need a summary in the Changelog.

Generated by 🚫 danger

Copy link
Member

@MP0w MP0w left a comment

Choose a reason for hiding this comment

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

I accidentally discarded my previous comment:
Looks like indentation is broken, maybe you have different settings. Please take look.
Other than this LGTM, ty for the PR 👍

@codecov-io
Copy link

codecov-io commented Oct 13, 2016

Current coverage is 99.58% (diff: 100%)

Merging #134 into master will increase coverage by <.01%

@@             master       #134   diff @@
==========================================
  Files            10         10          
  Lines           479        481     +2   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            477        479     +2   
  Misses            2          2          
  Partials          0          0          

Sunburst

Powered by Codecov. Last update a72a9a5...a6e2ea0

@joanromano
Copy link
Member

Also fine for me as soon as you fix the indentation issues. Special kudos for adding the unit test and keep the coverage up to date 👍

@hernangonzalez
Copy link
Contributor Author

@MP0w @joanromano updated 👍 , thanks.

@@ -283,10 +284,31 @@ public final class Router {
public func post(_ path: String, handler: @escaping RouteHandler) {
addRoute(with: path, method: .post, handler: handler)
}


/**
Copy link
Member

Choose a reason for hiding this comment

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

oh apparently all of this is still shifted

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ups 😢

- parameter handler: A `RouteHandler` handler that will be used when the route is matched for a GET request
*/
public func patch(_ path: String, handler: @escaping RouteHandler) {
addRoute(with: path, method: .patch, handler: handler)
Copy link
Member

Choose a reason for hiding this comment

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

and this line still has a tab I guess

@hernangonzalez
Copy link
Contributor Author

Sublime to the rescue 🙏

Copy link
Member

@joanromano joanromano left a comment

Choose a reason for hiding this comment

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

Looks like we are good to go! Thanks for the contribution 🍺 🍺 🍺

@@ -118,6 +118,7 @@ public final class Router {
case post = "POST"
case put = "PUT"
case delete = "DELETE"
case patch = "PATCH"
Copy link
Member

Choose a reason for hiding this comment

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

Please indent this properly

Copy link
Member

Choose a reason for hiding this comment

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

@joanromano I think we misuse the review... you add comments but people won't see it until you "finish" the review with one of the options (comment, approve, decline)...
so we couldn't see your comments until you approved 👎

Copy link
Member

Choose a reason for hiding this comment

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

FYI I think I did the same mistake before

Copy link
Member

Choose a reason for hiding this comment

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

oh, my bad then 😞 Sorry if that confused you @hernangonzalez

URLSession.shared.dataTask(with: request) { (_, _, _) in }.resume()

expect(calledPatch).toEventually(beTrue())
}
Copy link
Member

Choose a reason for hiding this comment

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

Also in this file indentations are wrong, could you please fix them?

Copy link
Member

@MP0w MP0w left a comment

Choose a reason for hiding this comment

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

ty, let's just wait for ci and I will merge 🎉
https://www.youtube.com/watch?v=SsoOG6ZeyUI :)

@MP0w
Copy link
Member

MP0w commented Oct 13, 2016

Travis has issues with macOS today, builds are delayed

@MP0w MP0w merged commit 32e8196 into devlucky:master Oct 14, 2016
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.

5 participants