Skip to content

Fix Ruby 3.3 constant lookup in engine.rb - #103

Open
zjhuntin wants to merge 1 commit into
theforeman:masterfrom
zjhuntin:fix/ruby33-constant-lookup
Open

Fix Ruby 3.3 constant lookup in engine.rb#103
zjhuntin wants to merge 1 commit into
theforeman:masterfrom
zjhuntin:fix/ruby33-constant-lookup

Conversation

@zjhuntin

Copy link
Copy Markdown

Summary

  • Qualify HostStatus, Host::Managed, and Hostgroup with :: prefix in engine.rb plugin registration block

On Ruby 3.3 (shipped with EL10), constant lookup inside nested blocks no longer falls through to top-level scope. Three unqualified constant references in the plugin registration block cause NameError at load time:

  • HostStatus::MonitoringStatus (line 65)
  • Host::Managed (line 77)
  • Hostgroup (line 78)

Notably, lines 90-91 in the same file already use ::Host::Managed and ::Hostgroup correctly — this PR makes the earlier references consistent.

On Ruby 3.3, constant lookup inside nested blocks no longer falls
through to top-level scope. Qualify HostStatus, Host::Managed, and
Hostgroup with :: to ensure they resolve correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant