diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index f69fd6aa3..45d1dd9c7 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -for cmd in curl git sed; do +for cmd in git tr; do if ! command -v "${cmd}" >/dev/null 2>&1; then echo "${cmd} is required for .devcontainer/post-create.sh" exit 1 @@ -45,21 +45,17 @@ fi echo "Initializing/updating git submodules" git submodule update --init --recursive -versions_json="$(curl -fsSL https://pages.github.com/versions.json)" || { - echo "Failed to fetch https://pages.github.com/versions.json" +ruby_version_file=".ruby-version" +if [[ ! -f "${ruby_version_file}" ]]; then + echo "Could not find ${ruby_version_file}" exit 1 -} - -pages_ruby_version="$( - printf '%s' "${versions_json}" | - sed -n 's/.*"ruby"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | - head -n 1 -)" +fi -echo "GitHub Pages Ruby version: ${pages_ruby_version}" +repo_ruby_version="$(tr -d '[:space:]' < "${ruby_version_file}")" +echo "Repository Ruby version: ${repo_ruby_version}" -if [[ -z "${pages_ruby_version}" ]]; then - echo "Could not determine Ruby version from https://pages.github.com/versions.json" +if [[ -z "${repo_ruby_version}" ]]; then + echo "Could not determine Ruby version from ${ruby_version_file}" exit 1 fi @@ -75,8 +71,8 @@ fi export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH" eval "$(rbenv init - bash)" -rbenv install -s "${pages_ruby_version}" -rbenv global "${pages_ruby_version}" +rbenv install -s "${repo_ruby_version}" +rbenv global "${repo_ruby_version}" rbenv rehash for profile in "$HOME/.bashrc" "$HOME/.zshrc"; do @@ -94,4 +90,4 @@ gem install bundler --no-document rbenv rehash mkdir -p "$HOME/.local/bin" ln -sf "$HOME/.rbenv/shims/bundle" "$HOME/.local/bin/bundle" -bundle install \ No newline at end of file +bundle install diff --git a/.gitignore b/.gitignore index 07b2cce5a..5e2e539b2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ assets/vendor/hint.css/src /vendor /.sass-cache -.ruby-version /tmp -Gemfile.lock .jekyll-metadata diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000..a0891f563 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.4 diff --git a/Gemfile b/Gemfile index 51b842501..8356cd74b 100644 --- a/Gemfile +++ b/Gemfile @@ -2,16 +2,17 @@ source 'https://rubygems.org' -require 'json' -require 'net/http' -versions = JSON.parse(Net::HTTP.get(URI('https://pages.github.com/versions.json'))) +gem 'jekyll', '~> 4.3' -gem 'github-pages', versions['github-pages'] +# Jekyll plugins listed in _config.yml +gem 'jekyll-github-metadata', '~> 2.16' +gem 'jekyll-redirect-from', '~> 0.16' +gem 'jekyll-seo-tag', '~> 2.8' +gem 'jekyll-sitemap', '~> 1.4' # Internationalization. Not on the GitHub Pages plugin whitelist, so the site is # built and deployed from GitHub Actions (.github/workflows/deploy.yml) rather than -# by the native Pages build. ~> 1.5 keeps compatibility with the Jekyll version -# pinned by the github-pages gem. +# by the native Pages build. gem 'jekyll-polyglot', '~> 1.5' # https://github.com/jekyll/jekyll/issues/8523 @@ -29,4 +30,5 @@ group :test do gem 'rake' gem 'rspec' gem 'rubocop' + gem 'safe_yaml', '~> 1.0' end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..cff6fcbb0 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,366 @@ +GIT + remote: https://github.com/licensee/licensee.git + revision: c96beb17be6ca7ef735063b779455f8b21dc0ee6 + branch: master + specs: + licensee (9.15.3) + dotenv (~> 2.0) + octokit (>= 4.20, < 7.0) + reverse_markdown (>= 1, < 3) + rugged (>= 0.24, < 2.0) + thor (>= 0.19, < 2.0) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) + base64 (0.3.0) + bigdecimal (4.1.2) + colorator (1.1.0) + colored (1.2) + concurrent-ruby (1.3.7) + csv (3.3.5) + diff-lcs (1.6.2) + dotenv (2.8.1) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + ethon (0.18.0) + ffi (>= 1.15.0) + logger + eventmachine (1.2.7) + faraday (2.14.3) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.4) + net-http (~> 0.5) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-aarch64-linux-musl) + ffi (1.17.4-arm-linux-gnu) + ffi (1.17.4-arm-linux-musl) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.4-x86_64-linux-musl) + forwardable-extended (2.6.0) + fuzzy_match (2.1.0) + google-protobuf (4.35.1) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-aarch64-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-aarch64-linux-musl) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-arm64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-x86_64-darwin) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-x86_64-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.35.1-x86_64-linux-musl) + bigdecimal + rake (~> 13.3) + html-proofer (3.19.4) + addressable (~> 2.3) + mercenary (~> 0.3) + nokogiri (~> 1.13) + parallel (~> 1.10) + rainbow (~> 3.0) + typhoeus (~> 1.3) + yell (~> 2.0) + http_parser.rb (0.8.1) + i18n (1.15.2) + concurrent-ruby (~> 1.0) + jekyll (4.4.1) + addressable (~> 2.4) + base64 (~> 0.2) + colorator (~> 1.0) + csv (~> 3.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.3, >= 0.3.6) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-github-metadata (2.16.1) + jekyll (>= 3.4, < 5.0) + octokit (>= 4, < 7, != 4.4.0) + jekyll-polyglot (1.13.0) + jekyll (>= 4.0, >= 3.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) + jekyll-seo-tag (2.9.0) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + json (2.21.0) + kramdown (2.5.2) + rexml (>= 3.4.4) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + language_server-protocol (3.17.0.6) + lint_roller (1.1.0) + liquid (4.0.4) + listen (3.10.0) + logger + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + mercenary (0.4.0) + net-http (0.9.1) + uri (>= 0.11.1) + nokogiri (1.19.4-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.4-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.19.4-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.4-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.19.4-arm64-darwin) + racc (~> 1.4) + nokogiri (1.19.4-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.19.4-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.4-x86_64-linux-musl) + racc (~> 1.4) + octokit (6.1.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + parallel (1.28.0) + parser (3.3.11.1) + ast (~> 2.4.1) + racc + pathutil (0.16.2) + forwardable-extended (~> 2.6) + prism (1.9.0) + public_suffix (7.0.5) + racc (1.8.1) + rainbow (3.1.1) + rake (13.4.2) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + regexp_parser (2.12.0) + reverse_markdown (2.1.1) + nokogiri + rexml (3.4.4) + rouge (4.7.0) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.8) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + rubocop (1.88.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.50.0) + parser (>= 3.3.7.2) + prism (~> 1.7) + ruby-progressbar (1.13.0) + rugged (1.9.4) + safe_yaml (1.0.5) + sass-embedded (1.101.0-aarch64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-aarch64-linux-musl) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-arm-linux-gnueabihf) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-arm-linux-musleabihf) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-arm64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-x86_64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-x86_64-linux-gnu) + google-protobuf (~> 4.31) + sass-embedded (1.101.0-x86_64-linux-musl) + google-protobuf (~> 4.31) + sawyer (0.9.3) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + thor (1.5.0) + typhoeus (1.6.0) + ethon (>= 0.18.0) + unicode-display_width (2.6.0) + uri (1.1.1) + webrick (1.9.2) + yell (2.2.2) + +PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-gnueabihf + arm-linux-musl + arm-linux-musleabihf + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + colored + fuzzy_match + html-proofer (~> 3.0) + jekyll (~> 4.3) + jekyll-github-metadata (~> 2.16) + jekyll-polyglot (~> 1.5) + jekyll-redirect-from (~> 0.16) + jekyll-seo-tag (~> 2.8) + jekyll-sitemap (~> 1.4) + licensee! + rake + rspec + rubocop + safe_yaml (~> 1.0) + terminal-table + webrick (~> 1.7) + +CHECKSUMS + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 + base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + bundler (4.0.16) sha256=d6ca5dd440c24f9abce9844cf44cc8e18c6a553de65a47efb4544137af92c47d + colorator (1.1.0) sha256=e2f85daf57af47d740db2a32191d1bdfb0f6503a0dfbc8327d0c9154d5ddfc38 + colored (1.2) sha256=9d82b47ac589ce7f6cab64b1f194a2009e9fd00c326a5357321f44afab2c1d2c + concurrent-ruby (1.3.7) sha256=4412caec3a5ea2e5fdc52076724c071a81f2c0593d83b2ac8cbb8ca63b3151b0 + csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f + diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962 + dotenv (2.8.1) sha256=c5944793349ae03c432e1780a2ca929d60b88c7d14d52d630db0508c3a8a17d8 + em-websocket (0.5.3) sha256=f56a92bde4e6cb879256d58ee31f124181f68f8887bd14d53d5d9a292758c6a8 + ethon (0.18.0) sha256=b598afc9f30448cb068b850714b7d6948e941476095d04f90a4ac65b8d6efcb2 + eventmachine (1.2.7) sha256=994016e42aa041477ba9cff45cbe50de2047f25dd418eba003e84f0d16560972 + faraday (2.14.3) sha256=1882247e6766615c8220b4392bf1d27f6ebb63d8e28267587cef1fb0bf37f278 + faraday-net_http (3.4.4) sha256=0e78af151747ed1b00f33e25973b4bc220d7f16c00c39676817c8b12331eb588 + ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df + ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39 + ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564 + ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95 + ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b + ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496 + ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d + ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e + forwardable-extended (2.6.0) sha256=1bec948c469bbddfadeb3bd90eb8c85f6e627a412a3e852acfd7eaedbac3ec97 + fuzzy_match (2.1.0) sha256=e97e25d0eaee48a5f77ed970d007c7b6ff3c6a6858303fead2d1986859204dfc + google-protobuf (4.35.1) sha256=a3a6471331d918f58dfa4d014a8f6286f0af2cf4840216bde52fcf2ea3fe3726 + google-protobuf (4.35.1-aarch64-linux-gnu) sha256=50ca44d0eeff3f8475e630a1accdd974256f3510694d574e2c9d6119ea8bc9e1 + google-protobuf (4.35.1-aarch64-linux-musl) sha256=d5c65cef6bd6498a9e5ed5f88cf6cf7e341c10b0a005e32137d5d1a2b6e8c18a + google-protobuf (4.35.1-arm64-darwin) sha256=d9c957df04fa89c749fa9a72a7b383eb4296efc9b2303dc6fd6fbe39c698ad6b + google-protobuf (4.35.1-x86_64-darwin) sha256=66b62b4df00931018a692806df66393efa960d6d2b7da69735187249f950d3ee + google-protobuf (4.35.1-x86_64-linux-gnu) sha256=c786439087512a3fbd199e9897d265b855f951d4027e218ea55e858d45969edd + google-protobuf (4.35.1-x86_64-linux-musl) sha256=91890eb0002934a339fdb7d77a147c46b7474b6799db27872b747b905837f744 + html-proofer (3.19.4) sha256=879420631c0271bccabcc1725663ce118bb6390fe26a7b38e22ecd886d8da62e + http_parser.rb (0.8.1) sha256=9ae8df145b39aa5398b2f90090d651c67bd8e2ebfe4507c966579f641e11097a + i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5 + jekyll (4.4.1) sha256=4c1144d857a5b2b80d45b8cf5138289579a9f8136aadfa6dd684b31fe2bc18c1 + jekyll-github-metadata (2.16.1) sha256=4cf29988bdaf24774a7bc07fae71e54424ddfaa2895f742d8fa3036d0db65b4c + jekyll-polyglot (1.13.0) sha256=a5667e78b587e75b9705d387c6709e5e2237f7e0ddc471afa32094974add8ee4 + jekyll-redirect-from (0.16.0) sha256=6635cae569ef9b0f90ffb71ec014ba977177fafb44d32a2b0526288d4d9be6db + jekyll-sass-converter (3.1.0) sha256=83925d84f1d134410c11d0c6643b0093e82e3a3cf127e90757a85294a3862443 + jekyll-seo-tag (2.9.0) sha256=0260015a8e1df9bf195cdfb0c675b7b2883fd8cbf12556e1c1cbe36a831c6852 + jekyll-sitemap (1.4.0) sha256=0de08c5debc185ea5a8f980e1025c7cd3f8e0c35c8b6ef592f15c46235cf4218 + jekyll-watch (2.2.1) sha256=bc44ed43f5e0a552836245a54dbff3ea7421ecc2856707e8a1ee203a8387a7e1 + json (2.21.0) sha256=8de199e53f93450414b9fd49811012a73f3e3265b60468c7274d1cacebde1969 + kramdown (2.5.2) sha256=1ba542204c66b6f9111ff00dcc26075b95b220b07f2905d8261740c82f7f02fa + kramdown-parser-gfm (1.1.0) sha256=fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729 + language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0 + licensee (9.15.3) + lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 + liquid (4.0.4) sha256=4fcfebb1a045e47918388dbb7a0925e7c3893e58d2bd6c3b3c73ec17a2d8fdb3 + listen (3.10.0) sha256=c6e182db62143aeccc2e1960033bebe7445309c7272061979bb098d03760c9d2 + logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 + mercenary (0.4.0) sha256=b25a1e4a59adca88665e08e24acf0af30da5b5d859f7d8f38fba52c28f405138 + net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996 + nokogiri (1.19.4-aarch64-linux-gnu) sha256=1269fb644a6de405057a53dd5c762b1209b43ca7424f839454d3dbc677c31a8f + nokogiri (1.19.4-aarch64-linux-musl) sha256=35c65b9ce72b3bb03207bdbe7067915019dc18c1b9b59139684bd6690fdd01af + nokogiri (1.19.4-arm-linux-gnu) sha256=a301313e38bb065d68239e79734bcd6f56fb6efaacebde29e9abf2a4735340ca + nokogiri (1.19.4-arm-linux-musl) sha256=588923c101bcfa78869734d247d25b598674323e7f22474fc468f6e5647311eb + nokogiri (1.19.4-arm64-darwin) sha256=a46db9853286e6597b36ebc6953817d15acf3a299583eb3f89fdc6f91dd63527 + nokogiri (1.19.4-x86_64-darwin) sha256=7fd17057d3e1f00e9954a74b3cd76595d3d4a5ef233b7ed9599047c204f70551 + nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a + nokogiri (1.19.4-x86_64-linux-musl) sha256=17dfb7c1fa194ae02fbf7c51a7afc8d278045ab3fdacfd86f91d02d7b274470b + octokit (6.1.1) sha256=920e4a9d820205f70738f58de6a7e6ef0e2f25b27db954b5806a63105207b0bf + parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970 + parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54 + pathutil (0.16.2) sha256=e43b74365631cab4f6d5e4228f812927efc9cb2c71e62976edcb252ee948d589 + prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 + racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f + rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe + rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e + regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb + reverse_markdown (2.1.1) sha256=b2206466b682ac1177b6b8ec321d00a84fca02d096c5d676a7a0cc5838dc0701 + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 + rouge (4.7.0) sha256=dba5896715c0325c362e895460a6d350803dbf6427454f49a47500f3193ea739 + rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587 + rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d + rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836 + rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47 + rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c + rubocop (1.88.2) sha256=8def251c90cd955feb4daa3edc0ab56893250c4ce90ef81e6c80c03f9a939bbf + rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db + ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + rugged (1.9.4) sha256=5876152be06568b413eb7eaccf3932a5b011a139fcf9330a680abdf16859dcd3 + safe_yaml (1.0.5) sha256=a6ac2d64b7eb027bdeeca1851fe7e7af0d668e133e8a88066a0c6f7087d9f848 + sass-embedded (1.101.0-aarch64-linux-gnu) sha256=8f6926349e880dbb4fda75fb182086fb60aa821b756bcbfc8e5b2b23b1f269d6 + sass-embedded (1.101.0-aarch64-linux-musl) sha256=0a02b4b75db305160db1b0512f040762242128a9b5c01b0fa7a504f2b24557f2 + sass-embedded (1.101.0-arm-linux-gnueabihf) sha256=358df7f98d13ff53739ebc45f5c5acd4dd96833bf87f39c74d11f798081d4158 + sass-embedded (1.101.0-arm-linux-musleabihf) sha256=d993a3ad017250d46d1312bc10cfded5ab4585906d37a60a56494bd662182d3a + sass-embedded (1.101.0-arm64-darwin) sha256=9fed684380b49499dfc856aba0d026a0748f924bd78044ffff2bae1537aea73e + sass-embedded (1.101.0-x86_64-darwin) sha256=20ff4afd7c052b3f8d7b4abe511e8114985a07dff7616750a43ee1fc2759fb28 + sass-embedded (1.101.0-x86_64-linux-gnu) sha256=ff48452b2351eaaf4e6e02f59de0e9e35f6f163e8456d520db49b4d87cf73c27 + sass-embedded (1.101.0-x86_64-linux-musl) sha256=2286feef3c7a8d9bbb075aa1651e1a81942aca1213f7c2d30cc1d6f4eb5b4104 + sawyer (0.9.3) sha256=0d0f19298408047037638639fe62f4794483fb04320269169bd41af2bdcf5e41 + terminal-table (3.0.2) sha256=f951b6af5f3e00203fb290a669e0a85c5dd5b051b3b023392ccfd67ba5abae91 + thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73 + typhoeus (1.6.0) sha256=bacc41c23e379547e29801dc235cd1699b70b955a1ba3d32b2b877aa844c331d + unicode-display_width (2.6.0) sha256=12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a + uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6 + webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131 + yell (2.2.2) sha256=1d166f3cc3b6dc49a59778ea7156ed6d8de794c15106d48ffd6cbb061b9b26bc + +BUNDLED WITH + 4.0.16 diff --git a/spec/ci_ruby_version_spec.rb b/spec/ci_ruby_version_spec.rb index 714cf8951..5fbe86559 100644 --- a/spec/ci_ruby_version_spec.rb +++ b/spec/ci_ruby_version_spec.rb @@ -1,34 +1,39 @@ # frozen_string_literal: true -require 'json' -require 'open-uri' require 'spec_helper' require 'yaml' describe 'ruby version' do - pages_versions = JSON.parse(URI.open('https://pages.github.com/versions.json').read) - pages_ruby_version = pages_versions['ruby'] + ruby_version_file = '.ruby-version' + repo_ruby_version = File.read(ruby_version_file).strip - ci_config_file = '.github/workflows/test.yml' - ci_config = YAML.load_file(ci_config_file) - ci_ruby_version = ci_config['jobs']['test']['steps'][1]['with']['ruby-version'] + [ + ['.github/workflows/test.yml', 'test'], + ['.github/workflows/deploy.yml', 'build'] + ].each do |ci_config_file, job_name| + ci_config = YAML.safe_load_file(ci_config_file) + setup_ruby_step = ci_config.dig('jobs', job_name, 'steps')&.find { |s| s['name'] == 'Set up Ruby' } + ci_ruby_version = setup_ruby_step&.dig('with', 'ruby-version').to_s - context "in #{ci_config_file} and pages ruby version" do - it 'match' do - msg = "#{ci_ruby_version} != #{pages_ruby_version}; please add a commit bumping in #{ci_config_file}" - expect(ci_ruby_version).to eql(pages_ruby_version), msg + context "in #{ci_config_file} and #{ruby_version_file}" do + it 'match' do + expect(setup_ruby_step).not_to be_nil, "No 'Set up Ruby' step found in #{ci_config_file}" + msg = "#{ci_ruby_version} != #{repo_ruby_version}; update #{ci_config_file} to match #{ruby_version_file}" + expect(ci_ruby_version).to eql(repo_ruby_version), msg + end end end rubocop_config_file = '.rubocop.yml' - rubocop_config = YAML.load_file(rubocop_config_file) - rubocop_ruby_version = rubocop_config['AllCops']['TargetRubyVersion'] - pages_ruby_version_minor = pages_ruby_version.match('^(\d+)\.(\d+)')[0] + rubocop_config = YAML.safe_load_file(rubocop_config_file) + rubocop_ruby_version = rubocop_config.dig('AllCops', 'TargetRubyVersion').to_s + repo_ruby_version_minor = repo_ruby_version.match('^(\d+)\.(\d+)')&.[](0) - context "in #{rubocop_config_file} and pages ruby minor version" do + context "in #{rubocop_config_file} and #{ruby_version_file} minor version" do it 'match' do - msg = "#{rubocop_ruby_version} != #{pages_ruby_version_minor}; please add a commit bumping in #{rubocop_config_file}" - expect(rubocop_ruby_version.to_s).to eql(pages_ruby_version_minor), msg + expect(repo_ruby_version_minor).not_to be_nil, "Could not parse minor version from #{ruby_version_file}: #{repo_ruby_version.inspect}" + msg = "#{rubocop_ruby_version} != #{repo_ruby_version_minor}; update #{rubocop_config_file} to match #{ruby_version_file}" + expect(rubocop_ruby_version).to eql(repo_ruby_version_minor), msg end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index be26f4541..f777fdbf4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,6 +4,7 @@ require 'json' require 'licensee' require 'open-uri' +require 'safe_yaml' module SpecHelper class << self