-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1200 from Fryguy/rake_task_sprint_details
Add rake task to aid in creating sprint details
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
desc "Generate a sprint details file for the given sprint number" | ||
task :generate_sprint_details, [:sprint_number] do |_task, args| | ||
# TODO: This is gross, and we need this code in a better location | ||
require_relative "../../../sprint_statistics/sprint_boundary_iterator" | ||
|
||
# TODO: There should be a class method on SprintBoundaryIterator that gets you the Sprint by number | ||
number, range = SprintBoundaryIterator.new.detect { |number, _range| number == args[:sprint_number].to_i} | ||
|
||
details = { | ||
"title" => "Sprint #{number} Details", | ||
"sprint_number" => number, | ||
"slides" => nil, | ||
"recording" => nil, | ||
"start_date" => range.begin, | ||
"end_date" => range.end, | ||
"review_date" => range.end + 2.days | ||
} | ||
details = details.to_yaml << "---\n" | ||
|
||
file = File.join(__dir__, "../../site/_sprints/#{number}.md") | ||
File.write(file, details) | ||
end |