gen-tj 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,16 @@
3
3
  This generates Taskjuggler (www.taskjugger.org) plans from (carefully
4
4
  designed) FATE entries combined with Bugzilla assignments.
5
5
 
6
+ == Usage
7
+
8
+ Check the samples/ directory for more information.
9
+
10
+ == Install
11
+
12
+ Install it with
13
+
14
+ gem install gen-tj
15
+
6
16
  == Commands
7
17
  === gen-buglist -- generate taskjuggler plans from Bugzilla
8
18
 
@@ -34,3 +44,7 @@ Usage
34
44
  Combining the three tasks (resources, buglist, tasklist) can easily be
35
45
  done with a Makefile as provided in the samples directory.
36
46
 
47
+ == Changelog
48
+
49
+ * v0.0.1 Initial release
50
+ * v0.0.2 Add priority to bug tasks
@@ -48,7 +48,7 @@ class Task
48
48
  t.add_relations relation, :noprio => true
49
49
  end
50
50
  t.priority = prio unless flags && flags[:noprio]
51
-
51
+
52
52
  self.add t
53
53
  end # relations.each
54
54
  end # def
@@ -38,24 +38,30 @@ module GenTJ
38
38
 
39
39
  # sort bugs according to priority
40
40
 
41
- prios = {}
41
+ prios = []
42
42
 
43
43
  bugs.each do |bug|
44
- prios[bug.priority] ||= []
45
- prios[bug.priority] << bug
44
+ pval = 0 # use index 0 for unprioritized
45
+ if bug.priority =~ /P([\d]+).*/
46
+ pval = $1.to_i + 1
47
+ end
48
+ prios[pval] ||= []
49
+ prios[pval] << bug
46
50
  end
47
51
 
48
52
  puts "task bugs \"Bugs\" {"
49
- prios.each do |k,v|
50
- pval = "_other"
51
- if k =~ /P(\d)+.*/
52
- pval = $1
53
- end
54
- puts "task p#{pval}_bugs \"Bugs with prio #{k}\" {"
55
- v.each do |bug|
53
+ prio = 900
54
+ # iterate over prios array, start with 1 (p1 bugs), end with 0 (unprioritized)
55
+ ((1..(prios.size-1)).to_a << 0).each do |i|
56
+ bugs = prios[i]
57
+ next if bugs.nil? || bugs.empty?
58
+ puts "task p#{(i==0)?'none':i}_bugs \"Bugs with prio #{bugs.first.priority}\" {"
59
+ puts "priority #{prio}"
60
+ bugs.each do |bug|
56
61
  puts bug.to_tj
57
62
  end
58
63
  puts "}"
64
+ prio -= 100
59
65
  end
60
66
  puts "}"
61
67
  end
@@ -52,7 +52,7 @@ class Task
52
52
  end
53
53
  t = @title.tr("\"", "'")
54
54
  s << " \"#{t}\" {\n"
55
- s << " priority #{1000-@priority}\n" if @priority
55
+ s << " priority #{900-@priority}\n" if @priority
56
56
  s << " start ${now}\n"
57
57
  if @subtasks
58
58
  @subtasks.each do |task|
@@ -1,5 +1,5 @@
1
1
  module GenTJ
2
2
  class GenTJ
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gen-tj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Klaus K\xC3\xA4mpf"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-28 00:00:00 +02:00
18
+ date: 2011-09-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency