-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release blog: generate release post without content #85
Conversation
GitHub: groongaGH-83 In this PR, we implement a Rake task for generating release announces in blog without contents. At the following PRs, we will implement contents step by step. Generate release announces ```console $ VERSION=14.1.1 rake release:blog:generate $ tree . | grep 2024-12-04-groonga-14.1.1.md │ └── 2024-12-04-groonga-14.1.1.md │ │ └── 2024-12-04-groonga-14.1.1.md ```
Because the version is updated when we generate the release posts.
release_task.rb
Outdated
end | ||
end | ||
end | ||
end | ||
|
||
def post_filename | ||
"#{Time.now.strftime("%F")}-#{@package.downcase}-#{@version}.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time.now
も_config.yml
から持ってこれませんか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 25ca18c...2c29500 共通して使いまわせそうだったので、_config.yml
から取得するように修正しました。
release_task.rb
Outdated
require "yaml" | ||
require "date" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ソートしてください。
require "yaml" | |
require "date" | |
require "date" | |
require "yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: a2662b0
release_task.rb
Outdated
jekyll_config["#{@package.downcase}_version"] | ||
end | ||
|
||
def detect_release_date | ||
jekyll_config["#{@package.downcase}_release_date"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
何回もパースしたくないんですが、どうにかなりませんか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 830f70e
release_task.rb
Outdated
@@ -28,14 +34,44 @@ def define | |||
|
|||
private | |||
|
|||
def jekyll_config | |||
YAML.safe_load_file("_config.yml", permitted_classes: [Date]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAML.safe_load_file("_config.yml", permitted_classes: [Date]) | |
YAML.safe_load_file(File.join(@jekyll_path, "_config.yml"), permitted_classes: [Date]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: e86ac25
release_task.rb
Outdated
end | ||
|
||
def detect_version | ||
jekyll_config["#{@package.downcase}_version"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なんども@package.downcase
しているのが気になるんですが、initialize
でpackage
じゃなくてproduct
あるいはproduct_label
として受け取って@product_id = product.downcase
して論理的にどういう値として扱っているかを名前でわかるようにするとか、なんとかなりませんか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 26072b2 どうするか悩んだのですが、initialize時に受け取った変数を変更せずに持っていたかったので、#product_id
メソッドで対応する形にしてみました。(ブログのポストの中で、Groonga
で利用するため)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@version
とかは事前に計算しているので合わせませんか?
@product
と@product_id
があってもおかしくないと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@version
とかをメソッドにする方に寄せるのでもいいと思います。
とにかく揃っていて欲しいです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: 624c7e5事前に計算する形に揃えました 🙏🏾
We pre-calculate the variables for generating release blog posts.
04be004
to
624c7e5
Compare
GitHub: GH-83
In this PR, we implement a Rake task for generating release announces in blog without contents.
At the following PRs, we will implement contents step by step.
Generate release posts