From bb59d95d95160fe945d622a78f7720479ae5195f Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 29 Mar 2023 10:55:02 -0400 Subject: [PATCH 1/3] docs: add a bit more detail to webdev, Ruby 3.2 Signed-off-by: Henry Schreiner --- .gitattributes | 1 + .github/actions/prepare-build-site/action.yml | 2 +- pages/docs/webdev.md | 43 +++++++++++++++---- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index b03dba8d0..7745046b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.min.* binary +*.svg binary diff --git a/.github/actions/prepare-build-site/action.yml b/.github/actions/prepare-build-site/action.yml index a8e39fc6c..91d29e472 100644 --- a/.github/actions/prepare-build-site/action.yml +++ b/.github/actions/prepare-build-site/action.yml @@ -4,7 +4,7 @@ inputs: ruby-version: description: "Version of ruby to prepare" required: false - default: "3.1" + default: "3.2" runs: using: composite diff --git a/pages/docs/webdev.md b/pages/docs/webdev.md index 6e31632cb..044481753 100644 --- a/pages/docs/webdev.md +++ b/pages/docs/webdev.md @@ -13,26 +13,39 @@ You can always click the edit button to make small edits to the website source, ### Installing Ruby -Visit [this page](https://jekyllrb.com/docs/installation/) for information about installing Ruby if your current version is too old; the instructions there form the basis for what you see here, and come in variants for all major operating systems. -You should have Ruby 2.6+ for Jekyll; 3.1 recommended and used in CI. You can use rbenv to manage multiple ruby versions. On macOS with homebrew, you'll want: +Visit [this page](https://jekyllrb.com/docs/installation/) for information +about installing Ruby if your current version is too old; the instructions +there form the basis for what you see here, and come in variants for all major +operating systems. You should have Ruby 2.6+ for Jekyll; 3.1+ recommended and +used in CI. You can use rbenv to manage multiple ruby versions. On macOS with +homebrew, you'll want: ```bash brew install rbenv ``` -You'll need to run `rbenv init` and follow the instructions for your current shell. After you've installed rbenv on your system, use: +You'll need to run: ```bash -rbenv install 3.1.2 +rbenv init ``` -to get a current version of ruby. Then, inside the main iris-hep website directory, run: +and **then follow the instructions printed for your current shell**. After you've installed rbenv on your system, use: ```bash -rbenv local 3.1.2 +rbenv install 3.2.1 ``` -This will run the Ruby you just built whenever you enter this directory. You'll want to install bundler too: +to get a current version of Ruby downloaded and built for your system. Then, +inside the main iris-hep website directory, run: + +```bash +rbenv local 3.2.1 +``` + +This will add a file (`.ruby-version`, if you are curious) to your local +directory that rbenv's shell integration will enable whenever you enter this +directory. You'll want to install bundler too: ```bash gem install bundle @@ -75,7 +88,7 @@ If you want to also perform the full link checking without exclusions, you can r bundle exec rake checkall ``` -If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can also run `bundle exec jekyll ...` directly. +If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can see all available tasks with `bundle exec rake --tasks`. You can also run `bundle exec jekyll ...` directly. ### Updating javascript files @@ -87,6 +100,20 @@ cat assets/js/myfile.js | openssl dgst -sha384 -binary | openssl base64 -A Run the site locally and verify no warnings appear in your terminal. Also turn on your browser's debugger and make sure no warnings are emitted. +### Updating Ruby files + +If you edit Ruby files, you should run `rubocop` to verify: + +```bash +bundle exec rake rubocop +``` + +If it suggests changes, you can often apply them automatically: + +```bash +bundle exec rake rubocop:auto_correct +``` + ### Styles Most style changes should be set in `assets/css/style.scss`. Some basic changes, like color variables, are set in the `_sass` directory. Please remember to consider multiple screen widths, printing (for relevant pages), and dark mode when changing or adding styles. You can see the defined colors [here](/docs/logos). From 1f9d8d98d386013844dabe1dc72f58bb5af356f3 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 29 Mar 2023 11:09:34 -0400 Subject: [PATCH 2/3] chore: update locked dependencies Signed-off-by: Henry Schreiner --- Gemfile.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 368f0836b..96aecaa7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,7 @@ GEM public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) colorator (1.1.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) diff-lcs (1.5.0) em-websocket (0.5.3) eventmachine (>= 0.12.9) @@ -61,8 +61,8 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) + liquid (4.0.4) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) @@ -79,7 +79,7 @@ GEM nokogiri (1.14.3-x86_64-linux) racc (~> 1.4) parallel (1.22.1) - parser (3.1.3.0) + parser (3.2.1.1) ast (~> 2.4.1) pathutil (0.16.2) forwardable-extended (~> 2.6) @@ -92,7 +92,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - regexp_parser (2.6.1) + regexp_parser (2.7.0) rexml (3.2.5) rouge (3.30.0) rubocop (1.25.1) @@ -104,8 +104,8 @@ GEM rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.0) - parser (>= 3.1.1.0) + rubocop-ast (1.28.0) + parser (>= 3.2.1.0) rubocop-rake (0.6.0) rubocop (~> 1.0) ruby-next (0.15.3) @@ -115,7 +115,7 @@ GEM ruby-next-core (0.15.3) ruby-next-parser (3.1.1.3) parser (>= 3.0.3.1) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -127,9 +127,9 @@ GEM unparser (0.6.4) diff-lcs (~> 1.3) parser (>= 3.1.0) - webrick (1.7.0) + webrick (1.8.1) yell (2.2.2) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS ruby From b083118e61fe4eb46f36fedf9b2bb596987e61d9 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 12 Oct 2023 10:39:43 -0400 Subject: [PATCH 3/3] Apply suggestions from code review --- pages/docs/webdev.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/docs/webdev.md b/pages/docs/webdev.md index 044481753..b6163cb5e 100644 --- a/pages/docs/webdev.md +++ b/pages/docs/webdev.md @@ -33,14 +33,14 @@ rbenv init and **then follow the instructions printed for your current shell**. After you've installed rbenv on your system, use: ```bash -rbenv install 3.2.1 +rbenv install 3.2.2 ``` to get a current version of Ruby downloaded and built for your system. Then, inside the main iris-hep website directory, run: ```bash -rbenv local 3.2.1 +rbenv local 3.2.2 ``` This will add a file (`.ruby-version`, if you are curious) to your local