Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions builders/ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion docs/caveats.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 5 additions & 5 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ 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:
myservice:
type: ruby:3.4
type: ruby:4.0
port: 80
command: tail -f /dev/null
```
Expand Down Expand Up @@ -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

Expand All @@ -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.
9 changes: 5 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ 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

* [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)
* [custom](https://docs.lando.dev/services/lando-3.html#overrides)

## Legacy versions

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)
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion examples/2.x/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ruby Example
Ruby 2.x Example
============

This example exists primarily to test the following documentation:
Expand Down
6 changes: 3 additions & 3 deletions examples/3.x/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions examples/3.x/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Ruby Example
Ruby 3.x Example
============

This example exists primarily to test the following documentation:
Expand All @@ -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"
Expand Down
16 changes: 16 additions & 0 deletions examples/4.x/.lando.yml
Original file line number Diff line number Diff line change
@@ -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": ./../../
43 changes: 43 additions & 0 deletions examples/4.x/README.md
Original file line number Diff line number Diff line change
@@ -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
```
14 changes: 14 additions & 0 deletions examples/4.x/server-custom.rb
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions examples/4.x/server.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading