Permalink
Browse files

* adding a show

 * correcting common
  • Loading branch information...
jkamenik committed Nov 3, 2010
1 parent 0ccf4d4 commit f3d34df8b6493286c917b01c7859941e6288faea
Showing with 43 additions and 8 deletions.
  1. +3 −3 common.rb
  2. +3 −3 list_tasks.rb
  3. +35 −0 show.rb
  4. +2 −2 tagged.rb
View
@@ -49,15 +49,15 @@ def std_rank(obj)
obj.rank || '---'
end
- def std_us(us)
+ def std_hierarchical_requirement(us)
escape "#{std_rank(us)} #{us.formatted_i_d} #{us.schedule_state} #{us.owner} #{us.name}"
end
- def std_ta(ta)
+ def std_task(ta)
escape "#{std_rank(ta)} #{ta.formatted_i_d}(#{ta.work_product.formatted_i_d}) #{ta.state} #{ta.owner} #{ta.name}"
end
- def std_de(de)
+ def std_defect(de)
str = escape "#{std_rank(de)} #{de.formatted_i_d} #{de.priority} #{de.schedule_state} #{de.state} #{de.owner}\n"
str += std_tags(de,"\t")
str += "\t#{de.name}"
View
@@ -50,7 +50,7 @@
end
}
}.each do |us|
- puts Common.std_us us
+ puts Common.render :us, us
end
puts '-'*80
@@ -71,7 +71,7 @@
end
}
}.each do |de|
- puts Common.std_de de
+ puts Common.render :de, de
end
puts '-'*80
@@ -90,7 +90,7 @@
}
}.each do |ta|
puts ' '*20+'-'*40+' '*20
- puts Common.std_ta ta
+ puts Common.render :ta, ta
puts Common.escape(ta.description) if ta.description
end
puts '-'*80
View
35 show.rb
@@ -0,0 +1,35 @@
+#!/usr/local/bin/ruby
+require 'rubygems'
+require 'rally_rest_api'
+require 'date'
+require File.dirname(__FILE__)+"/common"
+
+config = Common.load_config
+
+rally = RallyRestAPI.new(
+ :username => config[:username],
+ :password => config[:password]
+)
+
+unless (ARGV.size >= 2)
+ puts "You must specify a team and a schedule state"
+ exit 1
+end
+
+team = ARGV.shift
+state = ARGV.shift
+owners = config["#{team}_team".to_sym] || []
+
+
+[:de,:us].each do |type|
+ rally.find(Common.rally_type(type)) do
+ equal :schedule_state, state
+ _or_ {
+ owners.each do |x|
+ equal :owner, x
+ end
+ }
+ end.each do |x|
+ puts Common.render(type.to_sym,x)
+ end
+end
View
@@ -45,7 +45,7 @@
end
}
}.each do |us|
- puts Common.std_us us
+ puts Common.render :us, us
end
puts '-'*80
@@ -63,6 +63,6 @@
end
}
}.each do |de|
- puts Common.std_de de
+ puts Common.render :de, de
end
puts '-'*80

0 comments on commit f3d34df

Please sign in to comment.