Skip to content

Made Ruby Version #126

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions tools/update-pgroonga-upgrade-page.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env ruby

unless ARGV.length == 1 || ARGV.length == 2
puts "USAGE: ./update-pgroonga-upgrade-page.rb compatible"
puts "or"
puts "USAGE: ./update-pgroonga-upgrade-page.rb incompatible \"a reason of incompatible\""
exit 1
end

COMPATIBLE_OR_NOT = ARGV[0]

system("git clone [email protected]:pgroonga/pgroonga.git")
Dir.chdir("pgroonga") do
latest_version = `git tag --sort version:refname | tail -n 2 | sed -n '2p'`.strip
previous_version = `git tag --sort version:refname | tail -n 2 | sed -n '1p'`.strip
end
system("rm -rf pgroonga")

Dir.chdir("../")

if COMPATIBLE_OR_NOT == "compatible"
contents = <<-CONTENTS
* #{previous_version} -> #{latest_version}: o
CONTENTS

`sed -ie "/^Here is a list of compatibility/r /dev/stdin" upgrade/index.md`, stdin_data: contents
else
INCOMPATIBLE_REASON = ARGV[1]
contents = <<-CONTENTS
* #{previous_version} -> #{latest_version}: x
* #{INCOMPATIBLE_REASON}
CONTENTS

`sed -ie "/^Here is a list of compatibility/r /dev/stdin" upgrade/index.md`, stdin_data: contents
end

# TODO: I'll remove translation.
# Because contents of this page doesn't need to translate.
system("rake jekyll:i18n:translate")
system("git add _po/ja/upgrade/index.po")
system("git add ja/upgrade/index.md")
system("git add upgrade/index.md")

system("git commit -m \"upgrade: add #{previous_version} -> #{latest_version}\"")
# system("git push")