Skip to content

Commit

Permalink
Remove #product_id for consistency
Browse files Browse the repository at this point in the history
We pre-calculate the variables for generating release blog posts.
  • Loading branch information
otegami committed Dec 4, 2024
1 parent 26072b2 commit 04be004
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions release_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ReleaseTask
include Rake::DSL

def initialize(product, jekyll_path)
@product = product
@product_id = product.downcase
@jekyll_path = jekyll_path
@jekyll_config = load_jekyll_config
@version = detect_version
Expand All @@ -35,20 +35,16 @@ def define

private

def product_id
@product.downcase
end

def load_jekyll_config
YAML.safe_load_file(File.join(@jekyll_path, "_config.yml"), permitted_classes: [Date])
end

def detect_version
@jekyll_config["#{product_id}_version"]
@jekyll_config["#{@product_id}_version"]
end

def detect_release_date
@jekyll_config["#{product_id}_release_date"]
@jekyll_config["#{@product_id}_release_date"]
end

def define_generate_blog_task
Expand All @@ -63,13 +59,14 @@ def define_generate_blog_task
end

def post_filename
"#{@release_date.strftime("%F")}-#{product_id}-#{@version}.md"
"#{@release_date.strftime("%F")}-#{@product_id}-#{@version}.md"
end

def post_content(locale)
# TODO: We will write blog post contents here.
# After writing contents, we will remove this TODO comment.
"#{locale}, #{@product}, #{@version}"
product = @product_id.capitalize
"#{locale}, #{product}, #{@version}"
end

def generate_blog_posts
Expand Down

0 comments on commit 04be004

Please sign in to comment.