Open ryosuzuki opened 11 years ago
I add instance method to get path of blob and tree (and also add method to get repo)
You can get current blob path with @blob.path ( default is master branch)
@blob.path
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
repo = Grit::Repo.new(".") commit = repo.commits.first @blob = commit.tree/"lib/grit/blob.rb" @blob.path(commit) #=> "lib/grit/blob.rb"
Coverage remained the same when pulling 27f947fd660c7b64a262323c1588c38ecb2d2d61 on mitakalab:blob into 16e7586acc48691cd016447295bce62e524cce65 on gitlabhq:master.
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)And you can also set specific commit like this