Last active
March 10, 2021 00:23
-
-
Save kenzo-tanaka/f85997b6232ba9a9bfe0c9793a318b70 to your computer and use it in GitHub Desktop.
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
require 'active_support/time' | |
require 'active_support/core_ext' | |
output_txt = "" | |
start_of_month = Time.now.beginning_of_month.to_date.strftime("%Y-%m-%d") | |
end_of_month = Time.now.end_of_month.to_date.strftime("%Y-%m-%d") | |
date_range = (start_of_month..end_of_month) | |
date_range.each do |d| | |
text = <<~EOS | |
## #{d} | |
- [ ] TODO1 | |
- [ ] TODO2 | |
- [ ] TODO3 | |
EOS | |
output_txt << text | |
end | |
# File output | |
year = Date.today.year | |
month = Date.today.strftime("%m") # 03,04 | |
File.open("#{year}/#{month}/README.md", "w") { |f| f.write(output_txt) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
エディターとGitHubでシンプルなタスク管理をする