Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Get blob path (eg. @blob.path = 'lib/grit/blob.rb') #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryosuzuki
Copy link

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)

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"

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 27f947f on mitakalab:blob into 16e7586 on gitlabhq:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants