Class: Task

Inherits:
Object
  • Object
show all
Defined in:
lib/gen-tj/gen-tj.rb

Instance Method Summary collapse

Instance Method Details

#add_relations(relations, flags = nil) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/gen-tj/gen-tj.rb', line 21

def add_relations relations, flags = nil
  relations.each do |relation|
    id = relation.target
    f = Feature.get(id)
    
    unless f.milestone =~ /^1\.2/
	STDERR.puts "Skipping feature #{id} with milestone '#{f.milestone}'"
	next
    end

    raise "No feature #{id}" unless f
    prio = relation.sort_position
    t = Task.new f.title, id
    case f.developer
    when /<email.*>/
	alloc = Nokogiri.XML "<alloc>#{f.developer}</alloc>"
	alloc.xpath("//email").each do |mail|
 mail.text =~ /(.*)@(.*)/
 t.allocations << $1
	end
    when /(.*)@(.*)/
	t.allocations << $1
    else
	t.allocations << "dev"
    end

    if relation.parent
	t.add_relations relation, :noprio => true
    end
    t.priority = prio unless flags && flags[:noprio]

    self.add t
  end # relations.each
end