class RepositoryMerger::Repository

Attributes

path[R]

Public Class Methods

new(path) click to toggle source
# File lib/repository_merger/repository.rb, line 13
def initialize(path)
  @path = File.expand_path(path)
end

Public Instance Methods

==(other) click to toggle source
# File lib/repository_merger/repository.rb, line 21
def ==(other)
  path == other.path
end
Also aliased as: eql?
branch_for(name) click to toggle source
# File lib/repository_merger/repository.rb, line 35
def branch_for(name)
  rugged_branch = rugged_repo.branches[name]
  return nil unless rugged_branch
  Branch.new(rugged_branch, self)
end
branches() click to toggle source
# File lib/repository_merger/repository.rb, line 41
def branches
  rugged_repo.branches.map do |rugged_branch|
    Branch.new(rugged_branch, self)
  end
end
commit_for(commit_id) click to toggle source
# File lib/repository_merger/repository.rb, line 59
def commit_for(commit_id)
  object = rugged_repo.lookup(commit_id)
  return nil unless object.is_a?(Rugged::Commit)
  Commit.new(object, self)
end
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/repository_merger/repository.rb, line 27
def hash
  path.hash
end
name() click to toggle source
# File lib/repository_merger/repository.rb, line 31
def name
  File.basename(path)
end
rugged_repo() click to toggle source
# File lib/repository_merger/repository.rb, line 17
def rugged_repo
  @rugged_repo ||= Rugged::Repository.new(path)
end
tag_for(name) click to toggle source
# File lib/repository_merger/repository.rb, line 47
def tag_for(name)
  rugged_tag = rugged_repo.tags[name]
  return nil unless rugged_tag
  Tag.new(rugged_tag, self)
end
tags() click to toggle source
# File lib/repository_merger/repository.rb, line 53
def tags
  rugged_repo.tags.map do |rugged_tag|
    Tag.new(rugged_tag, self)
  end
end