class Gitra::Tracker

Public Class Methods

new(repository) click to toggle source
# File lib/gitra/tracker.rb, line 6
def initialize(repository)
  @git = Git.open(repository)
end

Public Instance Methods

branch(branch) click to toggle source
# File lib/gitra/tracker.rb, line 22
def branch(branch)
  TrackedBranch.new(@git, branch)
end
branches() { |name| ... } click to toggle source
# File lib/gitra/tracker.rb, line 14
def branches
  @git.branches.select do |branch|
    name = branch.full.gsub(%r{^remotes/}, '')
    next if name =~ / -> /
    block_given? ? yield(name) : true
  end.map { |branch| branch.full.gsub(%r{^remotes/}, '') }
end
current_branch() click to toggle source
# File lib/gitra/tracker.rb, line 10
def current_branch
  @git.current_branch
end
method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/gitra/tracker.rb, line 26
def method_missing(name, *args, &block)
  raise NoMethodError, "method `#{name}' should be used as `<tracker>.branch(reference).#{name}(<args>)'" if TrackedBranch.method_defined? name
  super
end