summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorTom Duffield <tom@chef.io>2016-11-21 08:30:37 -0600
committerTom Duffield <tom@chef.io>2016-11-21 08:30:37 -0600
commit306972ee8f0df6dd086e70a2b375be21a40f47b5 (patch)
tree9304b02c1e44b43712474aec597f2c91b8f4def7 /tasks
parent072e1f317549fa4df78ef9b7a72db090a164bcb7 (diff)
downloadchef-306972ee8f0df6dd086e70a2b375be21a40f47b5.tar.gz
Make maj_minor version first class in announcement generator
Signed-off-by: Tom Duffield <tom@chef.io>
Diffstat (limited to 'tasks')
-rw-r--r--tasks/announce.rb5
-rw-r--r--tasks/templates/prerelease.md.erb2
-rw-r--r--tasks/templates/release.md.erb2
3 files changed, 5 insertions, 4 deletions
diff --git a/tasks/announce.rb b/tasks/announce.rb
index 854c53a21b..5aa0b73d7e 100644
--- a/tasks/announce.rb
+++ b/tasks/announce.rb
@@ -20,10 +20,11 @@ require 'erb'
class ReleaseAnnouncement
include ERB::Util
- attr_accessor :type, :version, :date, :release_notes
+ attr_accessor :type, :version, :maj_minor, :date, :release_notes
def initialize(version, date, type)
@version = version
+ @maj_minor = version.split(".")[0..1].join(".")
@date = Date.parse(date) unless date.nil?
@release_notes = release_notes_from_file
@type = type
@@ -40,7 +41,7 @@ class ReleaseAnnouncement
end
def release_notes_from_file
- File.read("RELEASE_NOTES.md").match(/^# Chef Client Release Notes 12.17:\n\n(.*)/m)[1]
+ File.read("RELEASE_NOTES.md").match(/^# Chef Client Release Notes #{@maj_minor}:\n\n(.*)/m)[1]
end
end
diff --git a/tasks/templates/prerelease.md.erb b/tasks/templates/prerelease.md.erb
index f308b55bab..c5ebcebfa7 100644
--- a/tasks/templates/prerelease.md.erb
+++ b/tasks/templates/prerelease.md.erb
@@ -1,6 +1,6 @@
Ohai Chefs!
-We have selected <%= @version %> as our Chef v<%= @version.split(".")[0..1].join(".") %> release candidate which is scheduled for release on <%= @date.strftime('%A %B %-d, %Y') %>.
+We have selected <%= @version %> as our Chef v<%= @maj_minor %> release candidate which is scheduled for release on <%= @date.strftime('%A %B %-d, %Y') %>.
# Release Highlights
diff --git a/tasks/templates/release.md.erb b/tasks/templates/release.md.erb
index 7095bbb8c4..07270fd7e7 100644
--- a/tasks/templates/release.md.erb
+++ b/tasks/templates/release.md.erb
@@ -1,6 +1,6 @@
Ohai Chefs!
-We're happy to announce the release of Chef v<%= @version.split(".")[0..1].join(".") %>!
+We're happy to announce the release of Chef v<%= @maj_minor %>!
# Release Highlights