templates/saga/helpers.rb in saga-0.4.0 vs templates/saga/helpers.rb in saga-0.5.0

- old
+ new

@@ -3,13 +3,26 @@ [:name, :email, :company, :website].map do |key| author[key] end.compact.join(', ') end + def format_estimate(cardinality, interval) + case interval + when :days + "#{cardinality}d" + when :weeks + "#{cardinality}w" + else + cardinality.to_s + end + end + def format_story(story) story_attributes = [] story_attributes << "##{story[:id]}" if story[:id] - story_attributes << "##{story[:status]}" if story[:status] + story_attributes << story[:status] if story[:status] + story_attributes << format_estimate(*story[:estimate]) if story[:estimate] + story_attributes << "i#{story[:iteration]}" if story[:iteration] parts = [[story[:description], story_attributes.join(' ')].join(' - ')] parts << " #{story[:notes]}" if story[:notes] parts.join("\n\n") end \ No newline at end of file