Skip to content

Commit

Permalink
Print RUBY_DESCRIPTION when Puma starts (#3407)
Browse files Browse the repository at this point in the history
This commit changes the runner to print `RUBY_DESCRIPTION` instead of
a manually-generated string for the Ruby version. Other popular gems
like Sidekiq similarly print `RUBY_DESCRIPTION`. One specific motivation
for this change is that `RUBY_DESCRIPTION` indicates whether YJIT is
enabled in MRI.

This commit also deprecates the `Puma::Runner#ruby_engine` method,
which will be removed in v7.

Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
  • Loading branch information
JacobEvelyn and dentarg authored Nov 5, 2024
1 parent f9dcefb commit 4c55a1a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/puma/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def close_control_listeners
end

# @!attribute [r] ruby_engine
# @deprecated Use `RUBY_DESCRIPTION` instead
def ruby_engine
warn "Puma::Runner#ruby_engine is deprecated; use RUBY_DESCRIPTION instead. It will be removed in puma v7."

if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
"ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
else
Expand All @@ -109,7 +112,8 @@ def output_header(mode)
environment = @options[:environment]

log "Puma starting in #{mode} mode..."
log "* Puma version: #{Puma::Const::PUMA_VERSION} (#{ruby_engine}) (\"#{Puma::Const::CODE_NAME}\")"
log "* Puma version: #{Puma::Const::PUMA_VERSION} (\"#{Puma::Const::CODE_NAME}\")"
log "* Ruby version: #{RUBY_DESCRIPTION}"
log "* Min threads: #{min_t}"
log "* Max threads: #{max_t}"
log "* Environment: #{environment}"
Expand Down

0 comments on commit 4c55a1a

Please sign in to comment.