github/hub — pull request #437 by mauricerkelly (2013-11-22 14:10:52+00:00)
Title: Extend browse command to open current directory or specific path in repo

I've added this little extension to the `hub browse` command that allows the user to browse to a specific file (or directory) on the source tree on github.com. I'm not a regular Ruby dev so I'm happily submitting this pull request as a means of obtaining feedback - I'm fully expecting to have failed to follow conventions or best practices somewhere in here and am happy to be pointed straight.

```
hub browse github-services -f
> open https://github.com/YOUR_LOGIN/github-services/blob/master

hub browse github-services -f lib/github-services.rb
> open https://github.com/YOUR_LOGIN/github-services/blob/master/lib/github-services.rb
```

I chose to use a `-f` flag so as not to conflict with the normal default action of `browse`. I realise that technically what it does can be replicated by calling something like the following line, but this option I've added doesn't require manually typing `blob/BRANCH_NAME`.

```
hub browse github-services blob/master/lib/github-services.rb
> open https://github.com/YOUR_LOGIN/github-services/blob/master/lib/github-services.rb
```

Additionally, if you are within your repo hierarchy the -f option will use relative paths:

```
cd lib
hub browse github-services -f github-services.rb
> open https://github.com/YOUR_LOGIN/github-services/blob/master/lib/github-services.rb
```