New abilities:
$ hub compare
-> When on a branch that tracks "remotebranch", for example,
this opens "github.com/user/repo/compare/remotebranch".
In effect if the tracked branch is not "master".
$ hub browse reque issues
-> open http://github.com/user/resque/issues
$ hub browse
-> When on a branch that tracks "remotebranch", for example,
this opens "github.com/user/repo/tree/remotebranch".
In effect if the tracked branch is not "master".
$ hub browse -- commits
-> open http://github.com/user/repo/commits/master
If this branch is tracking a remote branch:
-> open http://github.com/user/repo/commits/remotebranch
Supported subpages:
- "tree" (default)
- "wiki"
- "commits"
- "issues", "network", "downloads" or any other arbitrary
string is simply appended to URL path
Fake `git` and `open` executables are pushed to PATH in testing and error
out when invoked. This is because there are tests that shell out to `git init`
and `git clone`, or open the browser, and bugs and failures in these tests
would previously cause them to poke around the system uncontrolled.
Less juggling of constants, more ruby methods. Information that requires
shelling out (e.g. GitHub username, token, repo name ...) is now loaded
on demand, meaning no shelling out for commands that don't need it.
Tests are now safer; they are prevented from shelling out to get info.
All test data is stubbed.
New `github_url` method builds needed URLs while keeping sensible defaults.
Commands that open the browser (`compare`, `browse`) now share a bit of
underlying implementation and recognize the same flags (`-p`, `-u`).
Usage example:
$ git fork
(forks "defunkt/hub" on GitHub)
(git remote add mislav git@github.com:mislav/hub.git)
new remote: mislav
Use `git fork --no-remote` to skip adding the new remote.
Tests use Webmock for stubbing out HTTP requests:
$ gem install webmock