Closed waylonflinn closed 8 years ago
@waylonflinn great patch - i've wanted this kind of thing for a while 😄
Any chance you could "squash" these commits - it would make reviewing a lot easier.
@rgrp glad you appreciate it. I'll combine a couple of those commits.
The 'Files Changed' tab is also handy for dealing with ambitious pull requests. :smile:
Squashed! :space_invader:
There are still a few commits here. So, to help sort through them, I'll describe the general pattern.
The format is a TDD flow that matches the following:
Since there are two features the result is two pairs of commits. Squashing merged the extraneous noise commits into one of the semantically important ones.
A bit more information about how it was accomplished might also help.
I made more extensive use of the node url
module. After extracting the parts of the path into an array (already present in the previous code) I edited those parts as necessary (along with the hostname) then used the url
module to reform them back into a valid URL (now pointing at github's raw server). In the process I also extracted information we care about (like branch and package name).
The first pair of commits implements most of that (and extracts the branch name). The second pair of commits is about correctly extracting the package name from branches.
Hope that makes it a bit easier to review! :book:
@waylonflinn this is just awesome and big props for TDD approach.
Reviewed and merged 👍
This patch correctly handles github urls that point to branches, subfolders and combinations of the two.
This feature more easily allows the scenario implemented in https://github.com/okfn/dpm/pull/51 and whose workaround is found in https://github.com/okfn/dpm/pull/52