class DtkCommon::GitRepo::Adapter::Rugged
Public Class Methods
new(repo_path,branch=nil)
click to toggle source
# File lib/git_repo/adapters/rugged.rb, line 29 def initialize(repo_path,branch=nil) if branch.nil? raise Error.new("Not implemented yet creating Rugged adapter w/o a branch") end @repo_branch = Branch.new(::Rugged::Repository.new(repo_path),branch) end
Public Instance Methods
get_file_content(path)
click to toggle source
# File lib/git_repo/adapters/rugged.rb, line 36 def get_file_content(path) get_tree().get_file_content(path) end
list_files()
click to toggle source
# File lib/git_repo/adapters/rugged.rb, line 40 def list_files() get_tree().list_files() end
Private Instance Methods
get_commit()
click to toggle source
# File lib/git_repo/adapters/rugged.rb, line 49 def get_commit() if rugged_ref = rugged_repo().refs.find {|ref|ref.name == "refs/heads/#{branch}"} Commit.new(@repo_branch,lookup(rugged_ref.target)) else raise ErrorUsage.new("Branch (#{branch} not found in repo (#{pp_repo()})") end end
get_tree()
click to toggle source
# File lib/git_repo/adapters/rugged.rb, line 45 def get_tree() get_commit().tree() end
pp_repo()
click to toggle source
# File lib/git_repo/adapters/rugged.rb, line 57 def pp_repo() rugged_repo().path() end