NARKOZ / gitlab

Ruby wrapper and CLI for the GitLab REST API
https://narkoz.github.io/gitlab
BSD 2-Clause "Simplified" License
1.06k stars 394 forks source link

Add the Merge Requests /diffs endpoint #661

Closed nickmalcolm closed 1 year ago

nickmalcolm commented 1 year ago

"List merge request diffs" appears to be missing from this gem, so this MR adds it. Thanks!

The fixture comes from the documentation.

Example usage:

> Gitlab.merge_request_diffs(33727711, 1)
=> [#<Gitlab::ObjectifiedHash:2120 {hash: {"diff"=>"@@ -4,6 +4,10 @@ This README is intended to be helpful for colleagues at GitLab. For everything e\n \n Please `@` me in comments, issues, and MRs. I use TODOs, and rarely check notification emails. You can also DM me on Slack.\n \n+## My role\n+\n+I'm on the Application Security Team ([role description](https://about.gitlab.com/job-families/engineering/application-security/)) and you can find the teams I work with [on this handbook page](https://about.gitlab.com/handbook/product/categories/).\n+\n ## Communication style\n \n I tend to be concise and direct. Some might say blunt. If I overstep please [give me feedback](https://about.gitlab.com/handbook/people-group/guidance-on-feedback/) so I can improve!\n@@ -19,6 +23,16 @@ I try to use te reo Māori kupu in my messages, particularly in Slack. Here are\n \n [MaoriDictionary.co.nz](https://maoridictionary.co.nz/) can be helpful too!\n \n-## Family\n+## Personal\n \n I am married and have two young boys ❤️ They might interrupt a meeting or mean I need to postpone. Thanks for understanding!\n+\n+I like (in no particular order):\n+\n+- Trail running\n+- Family time\n+- Lasagne\n+- Going to church\n+- Blobbing in front of the TV\n+- Reading fantasy (Riftwar Cycle, Wheel of Time, Kingkiller Chronicle, Mistborn, etc) or popcorn thriller (Jack Reacher)\n+- Learning about New Zealand history & te ao Māori\n", "new_path"=>"README.md", "old_path"=>"README.md", "a_mode"=>"100644", "b_mode"=>"100644", "new_file"=>false, "renamed_file"=>false, "deleted_file"=>false}}]
NARKOZ commented 1 year ago

Thank you ❤️