gitlabhq/grit — pull request #24 by ryooopan (2013-06-01 14:38:02+00:00)
Title: Get blob path (eg. @blob.path = 'lib/grit/blob.rb')

I add instance method to get path of blob and tree (and also add method to get repo)

# Usage

### Blob

You can get current blob path with `@blob.path` ( default is master branch)

```ruby
repo = Grit::Repo.new(".")
@blob = repo.tree/"lib/grit/blob.rb"
@blob.path
#=> "lib/grit/blob.rb"
```

And you can also set specific commit like this

```ruby
repo = Grit::Repo.new(".")
commit = repo.commits.first
@blob = commit.tree/"lib/grit/blob.rb"
@blob.path(commit)
#=> "lib/grit/blob.rb"
```