Class: Gitgo::Documents::Issue

Inherits:
Gitgo::Document show all
Defined in:
lib/gitgo/documents/issue.rb

Constant Summary

Constants inherited from Gitgo::Document

Gitgo::Document::AUTHOR, Gitgo::Document::DATE, Gitgo::Document::SHA

Instance Attribute Summary

Attributes inherited from Gitgo::Document

#attrs, #repo, #sha

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gitgo::Document

#==, #[], [], #[]=, #active?, #author, #author=, cast, #commit!, create, #create, #date, #date=, delete, #delete, #each_index, #errors, #graph, #graph_head, #graph_head?, #graph_head_idx, #idx, #index, #indexes, inherited, #initialize, #initialize_copy, #inspect, #link, #link_to, #merge, #merge!, #node, #normalize, #normalize!, read, #reindex, repo, #reset, #save, save, #saved?, #summary, #tags, type, #update, update, update_index, #update_to, #validate

Constructor Details

This class inherits a constructor from Gitgo::Document

Class Method Details

.find(all = {}, any = nil, update_index = true) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/gitgo/documents/issue.rb', line 7

def find(all={}, any=nil, update_index=true)
  self.update_index if update_index
  repo.index.select(
    :basis => basis, 
    :all => all, 
    :any => any, 
    :shas => true,
    :map => true
  ).collect! {|sha| self[sha] }
end

Instance Method Details

#graph_active?(commit = nil) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/gitgo/documents/issue.rb', line 42

def graph_active?(commit=nil)
  graph_tails.any? {|tail| tail.active?(commit) }
end

#graph_headsObject



30
31
32
# File 'lib/gitgo/documents/issue.rb', line 30

def graph_heads
  graph[graph_head].versions.collect {|head| Issue[head] or raise "missing head: #{head.inspect} (#{sha})" }
end

#graph_tagsObject



38
39
40
# File 'lib/gitgo/documents/issue.rb', line 38

def graph_tags
  graph_tails.collect {|tail| tail.tags }.flatten.uniq
end

#graph_tailsObject



46
47
48
# File 'lib/gitgo/documents/issue.rb', line 46

def graph_tails
  graph.tails.collect {|tail| Issue[tail] or raise "missing tail: #{tail.inspect} (#{sha})" }
end

#graph_titlesObject



34
35
36
# File 'lib/gitgo/documents/issue.rb', line 34

def graph_titles
  graph_heads.collect {|head| head.title }
end

#inherit(attrs = {}) ⇒ Object



50
51
52
53
# File 'lib/gitgo/documents/issue.rb', line 50

def inherit(attrs={})
  attrs['tags'] ||= graph_tags
  self.class.new(attrs, repo)
end