Skip to content

Commit

Permalink
Fix "lambda method requires a literal block" (Ruby 3.3) (#2141)
Browse files Browse the repository at this point in the history
Running the test suite on Ruby 3.2 produces this validation warning:

```
$ RUBYOPT=-W bundle e rspec spec/lib/capistrano/configuration_spec.rb
...
warning: lambda without a literal block is deprecated; use the proc without lambda instead
```

On Ruby 3.3 (head), it crashes because the deprecation is now an
error[^1]:

```
ArgumentError:
  the lambda method requires a literal block
```

This commit fixes the problem by replacing `lambda` with `proc`, as
instructed in the deprecation warning.

[^1]: https://bugs.ruby-lang.org/issues/19777
  • Loading branch information
mattbrictson committed Sep 26, 2023
1 parent c60cae8 commit f8a5e89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capistrano/configuration/validated_variables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def validate(key, &validator)
# works as expected.
#
def assert_valid_later(key, callable)
validation_callback = lambda do
validation_callback = proc do
value = callable.call
assert_valid_now(key, value)
value
Expand Down

0 comments on commit f8a5e89

Please sign in to comment.