mojombo/grit — pull request #167 by ryooopan (2013-05-29 13:16:30+00:00)
Title: Get path of the specific blob and tree

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

# Usage

### Tree

```ruby
@tree = @repo.tree/"lib/grit"
@tree.path
#=> "lib/grit"
```

And you also set specific commit like this

```ruby
commit = @repo.commits.first
@tree = @repo.tree/"lib/grit"
@tree.path(commit)
#=> "lib/grit"
```

### Blob

Blob is the almost same

```ruby
@blob = @repo.tree/"lib/grit/blob.rb"
@blob.path
#=> "lib/grit/blob.rb"
```

And you also set specific commit like this

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