Module: Gish::Commands::Label

Included in:
Gish
Defined in:
lib/gish/commands/label.rb

Instance Method Summary collapse

Instance Method Details

#create_label(name, color = nil) ⇒ Object



22
23
24
# File 'lib/gish/commands/label.rb', line 22

def create_label(name, color=nil)
  request { client.add_label(Gish.repository, name, color) }
end

#delete_labels(labels) ⇒ Object



9
10
11
12
13
# File 'lib/gish/commands/label.rb', line 9

def delete_labels(labels)
  labels.each do |l|
    request { client.delete_label!(Gish.repository, l) }
  end
end

#list_labelsObject



4
5
6
7
# File 'lib/gish/commands/label.rb', line 4

def list_labels
  labels = request { client.labels(Gish.repository) }
  labels.map{|l| Gish::Label.new(l) }
end

#update_label(name, new_name, color) ⇒ Object



15
16
17
18
19
20
# File 'lib/gish/commands/label.rb', line 15

def update_label(name, new_name, color)
  opts = {:name => new_name}
  opts[:color] = color unless color.nil?

  request { client.update_label(Gish.repository, name, opts) }
end