lib/saga/planning.rb in saga-0.6.0 vs lib/saga/planning.rb in saga-0.7.0

- old
+ new

@@ -25,20 +25,33 @@ total[:estimate_total_in_hours] += properties[:estimate_total_in_hours] end total end + def unestimated + unestimated = 0 + @document.stories.values.each do |stories| + stories.each do |story| + unestimated += 1 unless story[:estimate] + end + end + unestimated + end + def to_s if @document.empty? "There are no stories yet." else parts = iterations.keys.sort.map do |iteration| self.class.format_properties(iteration, iterations[iteration]) end - formatted_totals = self.class.format_properties(false, total) - parts << '-'*formatted_totals.length - parts << formatted_totals + unless parts.empty? + formatted_totals = self.class.format_properties(false, total) + parts << '-'*formatted_totals.length + parts << formatted_totals + end + parts << self.class.format_unestimated(unestimated) if unestimated > 0 parts.join("\n") end end def self.estimate_to_hours(estimate) @@ -58,8 +71,12 @@ else label = 'Total' end story_column = (properties[:story_count] == 1) ? "#{properties[:story_count]} story" : "#{properties[:story_count]} stories" "#{label.ljust(14)}: #{properties[:estimate_total_in_hours]} (#{story_column})" + end + + def self.format_unestimated(unestimated) + "Unestimated : #{unestimated > 1 ? "#{unestimated} stories" : 'one story' }" end end end \ No newline at end of file