From b5080221c7e65ef057b13c6affaae9ca4f992ac5 Mon Sep 17 00:00:00 2001 From: "Peter H. Boling" Date: Tue, 8 Jul 2025 23:26:09 +0000 Subject: [PATCH 1/9] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20devcont?= =?UTF-8?q?ainer=20for=20debugging=20with=20Ruby=202.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apt-install/devcontainer-feature.json | 9 ++++++ .devcontainer/apt-install/install.sh | 5 ++++ .devcontainer/devcontainer.json | 28 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .devcontainer/apt-install/devcontainer-feature.json create mode 100644 .devcontainer/apt-install/install.sh create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/apt-install/devcontainer-feature.json b/.devcontainer/apt-install/devcontainer-feature.json new file mode 100644 index 00000000..bf4d0e41 --- /dev/null +++ b/.devcontainer/apt-install/devcontainer-feature.json @@ -0,0 +1,9 @@ +{ + "name": "Apt Install Packages", + "id": "apt-install", + "version": "1.0.0", + "description": "More packages are needed", + "install": { + "script": "install.sh" + } +} \ No newline at end of file diff --git a/.devcontainer/apt-install/install.sh b/.devcontainer/apt-install/install.sh new file mode 100644 index 00000000..8aa40002 --- /dev/null +++ b/.devcontainer/apt-install/install.sh @@ -0,0 +1,5 @@ +#!/bin/sh +apt-get update -y +apt-get install -y direnv default-jdk git zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev +# Adds the direnv setup script to ~/.bashrc file (at the end) +echo 'eval "$(direnv hook bash)"' >> ~/.bashrc \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..9a21ec00 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,28 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ruby +{ + "name": "Ruby 2.5 on Debian", + "image": "ruby:2.5-slim-buster", // Specify the Ruby 2.5 image + "postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1\nupdate_rubygems > /dev/null 2>&1\n", // Optional: Run this command after the container is created + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "./apt-install": {} + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "ruby --version", + + // Configure tool-specific properties. + "customizations" : { + "jetbrains" : { + "backend" : "RubyMine" + } + }, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} From 89b8eccc0bbf64add290dd4036adfd140a5d848a Mon Sep 17 00:00:00 2001 From: "|7eter l-|. l3oling" Date: Mon, 14 Jul 2025 16:17:16 +0700 Subject: [PATCH 2/9] Update devcontainer.json Co-authored-by: Sutou Kouhei --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9a21ec00..5cab2b37 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby { "name": "Ruby 2.5 on Debian", - "image": "ruby:2.5-slim-buster", // Specify the Ruby 2.5 image + "image": "ruby:2.5-buster", // Specify the Ruby 2.5 image "postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1\nupdate_rubygems > /dev/null 2>&1\n", // Optional: Run this command after the container is created // Features to add to the dev container. More info: https://containers.dev/features. From f39019386de4bead9380d2c10340852660151a31 Mon Sep 17 00:00:00 2001 From: "|7eter l-|. l3oling" Date: Mon, 14 Jul 2025 17:27:15 +0700 Subject: [PATCH 3/9] Update .devcontainer/devcontainer.json Co-authored-by: Sutou Kouhei --- .devcontainer/devcontainer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5cab2b37..b9df1d61 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -22,7 +22,4 @@ "backend" : "RubyMine" } }, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" } From e97af70599d85848eea9383c2c2d1981150f7419 Mon Sep 17 00:00:00 2001 From: "|7eter l-|. l3oling" Date: Mon, 14 Jul 2025 17:28:29 +0700 Subject: [PATCH 4/9] Update .devcontainer/devcontainer.json Co-authored-by: Sutou Kouhei --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b9df1d61..3c7974f5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,7 +16,7 @@ // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "ruby --version", - // Configure tool-specific properties. + // Configure tool-specific properties. "customizations" : { "jetbrains" : { "backend" : "RubyMine" From 92a90f2b602ff23c5f3cc1ab7d2dc42396320b22 Mon Sep 17 00:00:00 2001 From: "|7eter l-|. l3oling" Date: Mon, 14 Jul 2025 17:28:40 +0700 Subject: [PATCH 5/9] Update .devcontainer/devcontainer.json Co-authored-by: Sutou Kouhei --- .devcontainer/devcontainer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3c7974f5..1ecb7828 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,9 +17,9 @@ // "postCreateCommand": "ruby --version", // Configure tool-specific properties. - "customizations" : { - "jetbrains" : { - "backend" : "RubyMine" + "customizations": { + "jetbrains": { + "backend": "RubyMine" } }, } From ddc5506754e94bea40c052a331aa0233ade17abc Mon Sep 17 00:00:00 2001 From: "|7eter l-|. l3oling" Date: Mon, 14 Jul 2025 17:29:10 +0700 Subject: [PATCH 6/9] Update .devcontainer/devcontainer.json Co-authored-by: Sutou Kouhei --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1ecb7828..9e7d4352 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,5 +21,5 @@ "jetbrains": { "backend": "RubyMine" } - }, + } } From a6b70a2ce1957e75a5747b973e3f6e5bb6bc4bdc Mon Sep 17 00:00:00 2001 From: "Peter H. Boling" Date: Mon, 14 Jul 2025 10:44:11 +0000 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=8E=A8=20Address=20code=20review=20fr?= =?UTF-8?q?om=20@kou?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add bundle install - Remove extra comments --- .../{ => 2.5}/apt-install/devcontainer-feature.json | 0 .devcontainer/{ => 2.5}/apt-install/install.sh | 0 .devcontainer/{ => 2.5}/devcontainer.json | 11 +++-------- 3 files changed, 3 insertions(+), 8 deletions(-) rename .devcontainer/{ => 2.5}/apt-install/devcontainer-feature.json (100%) rename .devcontainer/{ => 2.5}/apt-install/install.sh (100%) rename .devcontainer/{ => 2.5}/devcontainer.json (53%) diff --git a/.devcontainer/apt-install/devcontainer-feature.json b/.devcontainer/2.5/apt-install/devcontainer-feature.json similarity index 100% rename from .devcontainer/apt-install/devcontainer-feature.json rename to .devcontainer/2.5/apt-install/devcontainer-feature.json diff --git a/.devcontainer/apt-install/install.sh b/.devcontainer/2.5/apt-install/install.sh similarity index 100% rename from .devcontainer/apt-install/install.sh rename to .devcontainer/2.5/apt-install/install.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/2.5/devcontainer.json similarity index 53% rename from .devcontainer/devcontainer.json rename to .devcontainer/2.5/devcontainer.json index 9e7d4352..47e8b031 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/2.5/devcontainer.json @@ -2,20 +2,15 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/ruby { "name": "Ruby 2.5 on Debian", - "image": "ruby:2.5-buster", // Specify the Ruby 2.5 image - "postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1\nupdate_rubygems > /dev/null 2>&1\n", // Optional: Run this command after the container is created + "image": "ruby:2.5-buster", + "postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1 &&\nupdate_rubygems > /dev/null 2>&1 &&\nbundle install", // Features to add to the dev container. More info: https://containers.dev/features. + // Features run during the image build, and thus before the lifecycle hooks in this file, e.g., postCreateCommand "features": { "./apt-install": {} }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "ruby --version", - // Configure tool-specific properties. "customizations": { "jetbrains": { From 189300b4540e3c6286c8f3d80666f2e5bbd46639 Mon Sep 17 00:00:00 2001 From: "Peter H. Boling" Date: Tue, 15 Jul 2025 18:37:35 +0000 Subject: [PATCH 8/9] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Improve?= =?UTF-8?q?=20bundler=20setup=20for=20Devcontainer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2.5/apt-install/devcontainer-feature.json | 9 ----- .devcontainer/2.5/apt-install/install.sh | 5 --- .../bundle-config/devcontainer-feature.json | 9 +++++ .devcontainer/2.5/bundle-config/install.sh | 6 +++ .devcontainer/2.5/devcontainer.json | 4 +- Gemfile-ruby2_5.gemfile | 28 ++++++++++++++ Gemfile-ruby2_5.gemfile.lock | 38 +++++++++++++++++++ 7 files changed, 83 insertions(+), 16 deletions(-) delete mode 100644 .devcontainer/2.5/apt-install/devcontainer-feature.json delete mode 100644 .devcontainer/2.5/apt-install/install.sh create mode 100644 .devcontainer/2.5/bundle-config/devcontainer-feature.json create mode 100644 .devcontainer/2.5/bundle-config/install.sh create mode 100644 Gemfile-ruby2_5.gemfile create mode 100644 Gemfile-ruby2_5.gemfile.lock diff --git a/.devcontainer/2.5/apt-install/devcontainer-feature.json b/.devcontainer/2.5/apt-install/devcontainer-feature.json deleted file mode 100644 index bf4d0e41..00000000 --- a/.devcontainer/2.5/apt-install/devcontainer-feature.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Apt Install Packages", - "id": "apt-install", - "version": "1.0.0", - "description": "More packages are needed", - "install": { - "script": "install.sh" - } -} \ No newline at end of file diff --git a/.devcontainer/2.5/apt-install/install.sh b/.devcontainer/2.5/apt-install/install.sh deleted file mode 100644 index 8aa40002..00000000 --- a/.devcontainer/2.5/apt-install/install.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -apt-get update -y -apt-get install -y direnv default-jdk git zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev -# Adds the direnv setup script to ~/.bashrc file (at the end) -echo 'eval "$(direnv hook bash)"' >> ~/.bashrc \ No newline at end of file diff --git a/.devcontainer/2.5/bundle-config/devcontainer-feature.json b/.devcontainer/2.5/bundle-config/devcontainer-feature.json new file mode 100644 index 00000000..5f4cb243 --- /dev/null +++ b/.devcontainer/2.5/bundle-config/devcontainer-feature.json @@ -0,0 +1,9 @@ +{ + "name": "Bundle Config", + "id": "bundle-config", + "version": "1.0.0", + "description": "Bundle Config", + "install": { + "script": "install.sh" + } +} \ No newline at end of file diff --git a/.devcontainer/2.5/bundle-config/install.sh b/.devcontainer/2.5/bundle-config/install.sh new file mode 100644 index 00000000..d4340550 --- /dev/null +++ b/.devcontainer/2.5/bundle-config/install.sh @@ -0,0 +1,6 @@ +#!/bin/sh +RUBYGEMS_VERSION=3.3.27 +gem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1 && +update_rubygems > /dev/null 2>&1 +# Ensure we use the right Gemfile +echo 'export BUNDLE_GEMFILE=Gemfile-ruby2_5.gemfile' >> ~/.bashrc diff --git a/.devcontainer/2.5/devcontainer.json b/.devcontainer/2.5/devcontainer.json index 47e8b031..c0896b85 100644 --- a/.devcontainer/2.5/devcontainer.json +++ b/.devcontainer/2.5/devcontainer.json @@ -3,12 +3,12 @@ { "name": "Ruby 2.5 on Debian", "image": "ruby:2.5-buster", - "postCreateCommand": "RUBYGEMS_VERSION=3.3.27\ngem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1 &&\nupdate_rubygems > /dev/null 2>&1 &&\nbundle install", + "postCreateCommand": "bundle install", // Features to add to the dev container. More info: https://containers.dev/features. // Features run during the image build, and thus before the lifecycle hooks in this file, e.g., postCreateCommand "features": { - "./apt-install": {} + "./bundle-config": {} }, // Configure tool-specific properties. diff --git a/Gemfile-ruby2_5.gemfile b/Gemfile-ruby2_5.gemfile new file mode 100644 index 00000000..a680c133 --- /dev/null +++ b/Gemfile-ruby2_5.gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +# Specify your gem's dependencies in rexml.gemspec +gemspec + +group :development do + # This is for suppressing the following warning: + # + # warning: ostruct was loaded from the standard library, but will + # no longer be part of the default gems starting from Ruby 3.5.0. + # + # This should be part of "json". We can remove this when "json" + # depends on "ostruct" explicitly. + gem "ostruct" + gem "rake" + gem "rdoc" +end + +group :benchmark do + gem "benchmark_driver" +end + +group :test do + gem "test-unit" + gem "test-unit-ruby-core" +end diff --git a/Gemfile-ruby2_5.gemfile.lock b/Gemfile-ruby2_5.gemfile.lock new file mode 100644 index 00000000..63197510 --- /dev/null +++ b/Gemfile-ruby2_5.gemfile.lock @@ -0,0 +1,38 @@ +PATH + remote: . + specs: + rexml (3.4.2) + +GEM + remote: https://rubygems.org/ + specs: + benchmark_driver (0.16.5) + date (3.3.1) + ostruct (0.6.2) + power_assert (2.0.5) + psych (5.2.6) + date + stringio + rake (13.3.0) + rdoc (6.5.1.1) + psych (>= 4.0.0) + stringio (3.0.6) + test-unit (3.7.0) + power_assert + test-unit-ruby-core (1.0.7) + test-unit + +PLATFORMS + x86_64-linux + +DEPENDENCIES + benchmark_driver + ostruct + rake + rdoc + rexml! + test-unit + test-unit-ruby-core + +BUNDLED WITH + 2.3.27 From 5f5834070c3bd9fe066258503ff0f826c0b4d83f Mon Sep 17 00:00:00 2001 From: "Peter H. Boling" Date: Wed, 16 Jul 2025 03:00:33 +0000 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=94=A5=20Copy=20fresh=20Gemfile=20for?= =?UTF-8?q?=20Ruby=202.5=20each=20time=20devcontainer=20is=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/2.5/bundle-config/install.sh | 3 ++ .devcontainer/2.5/devcontainer.json | 2 +- .gitignore | 2 ++ Gemfile-ruby2_5.gemfile | 28 ---------------- Gemfile-ruby2_5.gemfile.lock | 38 ---------------------- 5 files changed, 6 insertions(+), 67 deletions(-) delete mode 100644 Gemfile-ruby2_5.gemfile delete mode 100644 Gemfile-ruby2_5.gemfile.lock diff --git a/.devcontainer/2.5/bundle-config/install.sh b/.devcontainer/2.5/bundle-config/install.sh index d4340550..a3da3a10 100644 --- a/.devcontainer/2.5/bundle-config/install.sh +++ b/.devcontainer/2.5/bundle-config/install.sh @@ -2,5 +2,8 @@ RUBYGEMS_VERSION=3.3.27 gem install rubygems-update -v ${RUBYGEMS_VERSION} > /dev/null 2>&1 && update_rubygems > /dev/null 2>&1 +# Depends on making a copy of the Gemfile, so we don't conflict with the Gemfile.lock +# that is probably relegated to newer Ruby. +# We need to set the ENV variable here, but must wait to copy the Gemfile until the postCreateCommand hook. # Ensure we use the right Gemfile echo 'export BUNDLE_GEMFILE=Gemfile-ruby2_5.gemfile' >> ~/.bashrc diff --git a/.devcontainer/2.5/devcontainer.json b/.devcontainer/2.5/devcontainer.json index c0896b85..88ccca81 100644 --- a/.devcontainer/2.5/devcontainer.json +++ b/.devcontainer/2.5/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Ruby 2.5 on Debian", "image": "ruby:2.5-buster", - "postCreateCommand": "bundle install", + "postCreateCommand": "cp Gemfile Gemfile-ruby2_5.gemfile && bundle install", // Features to add to the dev container. More info: https://containers.dev/features. // Features run during the image build, and thus before the lifecycle hooks in this file, e.g., postCreateCommand diff --git a/.gitignore b/.gitignore index aeae5f29..dcb64e83 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /spec/reports/ /tmp/ Gemfile.lock +*.gemfile +*.gemfile.lock \ No newline at end of file diff --git a/Gemfile-ruby2_5.gemfile b/Gemfile-ruby2_5.gemfile deleted file mode 100644 index a680c133..00000000 --- a/Gemfile-ruby2_5.gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - -# Specify your gem's dependencies in rexml.gemspec -gemspec - -group :development do - # This is for suppressing the following warning: - # - # warning: ostruct was loaded from the standard library, but will - # no longer be part of the default gems starting from Ruby 3.5.0. - # - # This should be part of "json". We can remove this when "json" - # depends on "ostruct" explicitly. - gem "ostruct" - gem "rake" - gem "rdoc" -end - -group :benchmark do - gem "benchmark_driver" -end - -group :test do - gem "test-unit" - gem "test-unit-ruby-core" -end diff --git a/Gemfile-ruby2_5.gemfile.lock b/Gemfile-ruby2_5.gemfile.lock deleted file mode 100644 index 63197510..00000000 --- a/Gemfile-ruby2_5.gemfile.lock +++ /dev/null @@ -1,38 +0,0 @@ -PATH - remote: . - specs: - rexml (3.4.2) - -GEM - remote: https://rubygems.org/ - specs: - benchmark_driver (0.16.5) - date (3.3.1) - ostruct (0.6.2) - power_assert (2.0.5) - psych (5.2.6) - date - stringio - rake (13.3.0) - rdoc (6.5.1.1) - psych (>= 4.0.0) - stringio (3.0.6) - test-unit (3.7.0) - power_assert - test-unit-ruby-core (1.0.7) - test-unit - -PLATFORMS - x86_64-linux - -DEPENDENCIES - benchmark_driver - ostruct - rake - rdoc - rexml! - test-unit - test-unit-ruby-core - -BUNDLED WITH - 2.3.27