From a3451f14347695eeb64fd610b3ce992c9b84c60f Mon Sep 17 00:00:00 2001 From: Christopher Bennell Date: Wed, 21 Jan 2026 09:32:15 -0500 Subject: [PATCH 1/2] Support Ruby 4.0 and mark 3.1 as legacy --- CHANGELOG.md | 2 ++ README.md | 2 +- builders/ruby.js | 4 ++-- docs/config.md | 2 +- docs/index.md | 5 ++-- examples/2.x/README.md | 2 +- examples/3.x/.lando.yml | 6 ++--- examples/3.x/README.md | 8 +++---- examples/4.x/.lando.yml | 16 +++++++++++++ examples/4.x/README.md | 43 +++++++++++++++++++++++++++++++++++ examples/4.x/server-custom.rb | 14 ++++++++++++ examples/4.x/server.rb | 14 ++++++++++++ 12 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 examples/4.x/.lando.yml create mode 100644 examples/4.x/README.md create mode 100644 examples/4.x/server-custom.rb create mode 100644 examples/4.x/server.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f04a8..6e26fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +- Added support for Ruby 4.0 and marked 3.1 as legacy + ## v1.5.0 - [January 9, 2025](https://github.com/lando/ruby/releases/tag/v1.5.0) * Added support for Ruby 3.4 diff --git a/README.md b/README.md index 638daed..405d4e9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Add a `ruby` service to your Landofile ```yaml services: myservice: - type: ruby:3.4 + type: ruby:4.0 ``` For more info you should check out the [docs](https://docs.lando.dev/ruby): diff --git a/builders/ruby.js b/builders/ruby.js index 4390b5d..b543a06 100644 --- a/builders/ruby.js +++ b/builders/ruby.js @@ -8,10 +8,10 @@ module.exports = { name: 'ruby', config: { version: '2.7', - supported: ['3.4', '3.3', '3.2', '3.1', '3.0', '2.7', '2.6', '2.5', '2.4', '2.3', '1.9'], + supported: ['4.0', '3.4', '3.3', '3.2', '3.1', '3.0', '2.7', '2.6', '2.5', '2.4', '2.3', '1.9'], patchesSupported: true, command: 'tail -f /dev/null', - legacy: ['3.0', '2.6', '2.5', '2.4', '2.3', '1.9'], + legacy: ['3.1', '3.0', '2.6', '2.5', '2.4', '2.3', '1.9'], moreHttpPorts: [], path: [ '/usr/local/sbin', diff --git a/docs/config.md b/docs/config.md index 7a224c4..1ca3f2e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -12,7 +12,7 @@ Also note that the options, in addition to the [build steps](https://docs.lando. ```yaml services: myservice: - type: ruby:3.4 + type: ruby:4.0 port: 80 command: tail -f /dev/null ``` diff --git a/docs/index.md b/docs/index.md index 0a76c69..6139458 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,10 +12,10 @@ You can easily add it to your Lando app by adding an entry to the [services](htt ## Supported versions +* [4.0](https://hub.docker.com/_/ruby) * [3.4](https://hub.docker.com/_/ruby) * [3.3](https://hub.docker.com/_/ruby) * [3.2](https://hub.docker.com/_/ruby) -* [3.1](https://hub.docker.com/_/ruby) * **[2.7](https://hub.docker.com/_/ruby)** **(default)** * [custom](https://docs.lando.dev/core/v3/services/lando.html#overrides) @@ -23,6 +23,7 @@ You can easily add it to your Lando app by adding an entry to the [services](htt You can still run these versions with Lando but for all intents and purposes they should be considered deprecated (e.g. YMMV and do not expect a ton of support if you have an issue). +* [3.1](https://hub.docker.com/_/ruby) * [3.0](https://hub.docker.com/_/ruby) * [2.6](https://hub.docker.com/_/ruby) * [2.5](https://hub.docker.com/_/ruby) @@ -43,7 +44,7 @@ To use a patch version, you can do something as shown below: ```yaml services: myservice: - type: ruby:3.4.1 + type: ruby:4.0.1 ``` But make sure you use one of the available [patch tags](https://hub.docker.com/_/ruby/tags) for the underlying image we are using. diff --git a/examples/2.x/README.md b/examples/2.x/README.md index 0d0e6e2..0f30103 100644 --- a/examples/2.x/README.md +++ b/examples/2.x/README.md @@ -1,4 +1,4 @@ -Ruby Example +Ruby 2.x Example ============ This example exists primarily to test the following documentation: diff --git a/examples/3.x/.lando.yml b/examples/3.x/.lando.yml index 219f7e0..fc36cc8 100644 --- a/examples/3.x/.lando.yml +++ b/examples/3.x/.lando.yml @@ -4,13 +4,13 @@ services: type: ruby:3.4 command: ruby /app/server.rb custom: - type: ruby:3.1 + type: ruby:3.3 port: 8080 command: ruby /app/server-custom.rb patch: - type: ruby:3.1.2 + type: ruby:3.3.1 cli: - type: ruby:3.1 + type: ruby:3.4 v3_2: type: ruby:3.2 v3_3: diff --git a/examples/3.x/README.md b/examples/3.x/README.md index ec56ce4..b144610 100644 --- a/examples/3.x/README.md +++ b/examples/3.x/README.md @@ -1,4 +1,4 @@ -Ruby Example +Ruby 3.x Example ============ This example exists primarily to test the following documentation: @@ -25,11 +25,11 @@ Run the following commands to validate things are rolling as they should. # Should use 3.4.x as the defined version lando ssh -s defaults -c "ruby --version | grep 3.4." -# Should use 3.1.x as the defined version -lando ssh -s custom -c "ruby --version | grep 3.1." +# Should use 3.3.x as the defined version +lando ssh -s custom -c "ruby --version | grep 3.3." # Should use the user specified patch version when set -lando ssh -s patch -c "ruby --version | grep 3.1.2" +lando ssh -s patch -c "ruby --version | grep 3.3.1" # Should run on the custom port when specified lando ssh -s custom -c "curl http://localhost:8080 | grep OHNO" diff --git a/examples/4.x/.lando.yml b/examples/4.x/.lando.yml new file mode 100644 index 0000000..7b6c902 --- /dev/null +++ b/examples/4.x/.lando.yml @@ -0,0 +1,16 @@ +name: lando-ruby-4 +services: + defaults: + type: ruby:4.0 + command: ruby /app/server.rb + custom: + type: ruby:4.0 + port: 8080 + command: ruby /app/server-custom.rb + cli: + type: ruby:4.0 + +# This is important because it lets lando know to test against the plugin in this repo +# DO NOT REMOVE THIS! +plugins: + "@lando/ruby": ./../../ diff --git a/examples/4.x/README.md b/examples/4.x/README.md new file mode 100644 index 0000000..5202173 --- /dev/null +++ b/examples/4.x/README.md @@ -0,0 +1,43 @@ +# Ruby 4.x Example + +This example exists primarily to test the following documentation: + +- [Ruby Service](https://docs.devwithlando.io/tutorials/ruby.html) + +## Start up tests + +Run the following commands to get up and running with this example. + +```bash +# Should start up successfully +lando poweroff +lando start +``` + +## Verification commands + +Run the following commands to validate things are rolling as they should. + +```bash +# Should use 4.0.x as the defined version +lando ssh -s defaults -c "ruby --version | grep 4.0." + +# Should run on the custom port when specified +lando ssh -s custom -c "curl http://localhost:8080 | grep OHNO" + +# Should run on port 80 by default +lando ssh -s defaults -c "curl http://localhost | grep TROUBLE" + +# Should not serve port 80 for cli +lando ssh -s cli -c "curl http://localhost" || echo $? | grep 7 +``` + +## Destroy tests + +Run the following commands to trash this app like nothing ever happened. + +```bash +# Should be destroyed with success +lando destroy -y +lando poweroff +``` diff --git a/examples/4.x/server-custom.rb b/examples/4.x/server-custom.rb new file mode 100644 index 0000000..87e4d5a --- /dev/null +++ b/examples/4.x/server-custom.rb @@ -0,0 +1,14 @@ +require 'socket' +server = TCPServer.new 8080 + +while session = server.accept + request = session.gets + puts request + + session.print "HTTP/1.1 200\r\n" # 1 + session.print "Content-Type: text/html\r\n" # 2 + session.print "\r\n" # 3 + session.print "OHNO The time is #{Time.now}" #4 + + session.close +end diff --git a/examples/4.x/server.rb b/examples/4.x/server.rb new file mode 100644 index 0000000..9ba0214 --- /dev/null +++ b/examples/4.x/server.rb @@ -0,0 +1,14 @@ +require 'socket' +server = TCPServer.new 80 + +while session = server.accept + request = session.gets + puts request + + session.print "HTTP/1.1 200\r\n" # 1 + session.print "Content-Type: text/html\r\n" # 2 + session.print "\r\n" # 3 + session.print "TROUBLETROUBLETROUBLE The time is #{Time.now}" #4 + + session.close +end From 3feccbdda6b1fb3ba00e47b7ebb1e270882a8c83 Mon Sep 17 00:00:00 2001 From: Christopher Bennell Date: Wed, 21 Jan 2026 16:16:49 -0500 Subject: [PATCH 2/2] Update links in documentation --- docs/caveats.md | 2 +- docs/config.md | 8 ++++---- docs/index.md | 4 ++-- netlify.toml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/caveats.md b/docs/caveats.md index 26747ca..07fb617 100644 --- a/docs/caveats.md +++ b/docs/caveats.md @@ -20,4 +20,4 @@ Lando will set the `PATH` hierarchy for this service as follows: ] ``` -This is useful to note if you are not using absolute paths in any [tooling routes](https://docs.lando.dev/core/v3/tooling.html) and are getting the unexpected version of a particular utility. +This is useful to note if you are not using absolute paths in any [tooling routes](https://docs.lando.dev/landofile/tooling.html) and are getting the unexpected version of a particular utility. diff --git a/docs/config.md b/docs/config.md index 1ca3f2e..4015772 100644 --- a/docs/config.md +++ b/docs/config.md @@ -5,9 +5,9 @@ description: Learn how to configure the Lando Ruby service. # Configuration -Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/core/v3/services/lando.html) to get a good handle on how the magicks work. +Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/services/lando-3.html) to get a good handle on how the magicks work. -Also note that the options, in addition to the [build steps](https://docs.lando.dev/core/v3/services/lando.html#build-steps) and [overrides](https://docs.lando.dev/core/v3/services/lando.html#overrides) that are available to every service, are shown below: +Also note that the options, in addition to the [build steps](https://docs.lando.dev/services/lando-3.html#build-steps) and [overrides](https://docs.lando.dev/services/lando-3.html#overrides) that are available to every service, are shown below: ```yaml services: @@ -57,7 +57,7 @@ You can then invoke them on the command line. lando dotnet ``` -Lando tooling is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/core/v3/tooling.html) of its cool features. +Lando tooling is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/landofile/tooling.html) of its cool features. ## Adding routing @@ -70,4 +70,4 @@ proxy: - something.else.local ``` -Lando proxying is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/core/v3/proxy.html) of its cool features. +Lando proxying is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/landofile/proxy.html) of its cool features. diff --git a/docs/index.md b/docs/index.md index 6139458..2316787 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ next: ./config.html [Ruby](https://www.ruby-lang.org/en/) A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. -You can easily add it to your Lando app by adding an entry to the [services](https://docs.lando.dev/core/v3/services/lando.html) top-level config in your [Landofile](https://docs.lando.dev/core/v3). +You can easily add it to your Lando app by adding an entry to the [services](https://docs.lando.dev/services/lando-3.html) top-level config in your [Landofile](https://docs.lando.dev/landofile/). ## Supported versions @@ -17,7 +17,7 @@ You can easily add it to your Lando app by adding an entry to the [services](htt * [3.3](https://hub.docker.com/_/ruby) * [3.2](https://hub.docker.com/_/ruby) * **[2.7](https://hub.docker.com/_/ruby)** **(default)** -* [custom](https://docs.lando.dev/core/v3/services/lando.html#overrides) +* [custom](https://docs.lando.dev/services/lando-3.html#overrides) ## Legacy versions diff --git a/netlify.toml b/netlify.toml index fb42e1c..6d0c293 100644 --- a/netlify.toml +++ b/netlify.toml @@ -10,7 +10,7 @@ [[context.deploy-preview.plugins]] package = "netlify-plugin-checklinks" [context.deploy-preview.plugins.inputs] - todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ] + todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/", "hub.docker.com" ] skipPatterns = [ ".rss", ".gif", ".jpg" ] checkExternal = true