Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "lambda method requires a literal block" error (Ruby 3.3) #2141

Merged
merged 1 commit into from Sep 26, 2023

Conversation

mattbrictson
Copy link
Member

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 error1:

ArgumentError:
  the lambda method requires a literal block

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

Footnotes

  1. https://bugs.ruby-lang.org/issues/19777

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
@mattbrictson mattbrictson added the 🐛 Bug Fix Fixes a bug label Sep 22, 2023
@capistrano-bot
Copy link

1 Warning
⚠️ There are code changes, but no corresponding tests. Please include tests if this PR introduces any modifications in behavior.

Generated by 🚫 Danger

@mattbrictson mattbrictson merged commit f8a5e89 into master Sep 26, 2023
17 of 18 checks passed
@mattbrictson mattbrictson deleted the bugs/fix-lambda-error-ruby-3.3 branch September 26, 2023 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants