grosser/vendorer — pull request #8 by mbrictson (2012-04-04 17:33:49+00:00)
Title: Add `from` scope to allow file fetching from (private, non-GitHub) Git repositories

Often times I want to use vendorer to grab a single file from a remote Git repository. Currently, the way to do this is using GitHub's raw URL, like this:

```
file "jquery-ui.widget.js", "https://raw.github.com/jquery/jquery-ui/master/ui/jquery.ui.widget.js"
```

However, there two major limitations with this approach:

1. If the GitHub repository isn't public, the raw URL won't work. It is possible to include a authentication token in the URL, but hard-coding a private token into a Vendorfile is not a good idea.
2. More importantly, private or not, these raw URLs only work for GitHub. To fetch single file from a non-GitHub Git repository, there is no easy answer.

My proposal is to introduce a `from` scope that allows a Git repository to be declared; `file` and `folder` declarations within this scope would fetch from that Git repository.

So to rewrite the jQuery example above:

```
from "https://github.com/jquery/jquery-ui.git" do
file "jquery-ui.widget.js", "ui/jquery.ui.widget.js"
end
```

Following vendorer conventions, Git refs are also supported:

```
from "https://github.com/jquery/jquery-ui.git", :branch => "1-8-stable" do
file "jquery-ui.widget.js", "ui/jquery.ui.widget.js"
end
```

More importantly, private repositories are supported (assuming of course the developer has SSH set up properly). Nested `folder` declarations work too.

```
from "git@github.com:mbrictson/my-private-repo.git" do
file "foo" # Copy foo from my-private-repo/foo
folder "bin" # Copy entire bin folder from my-private-repo/bin/
end
```