An interpreter of object-oriented scripting language
Go to file
Jarek Prokop 50e278ea0a Fix printing warnings when using IRB from a script.
IRB, when used from within ruby code using simple `require 'irb'; binding.irb`,
a lot of warning messages about already initialized constants, similar to:
"/usr/share/ruby/irb/ruby-lex.rb:123: warning: already initialized constant RubyLex::ERROR_TOKENS"
"/usr/share/gems/gems/irb-1.3.5/lib/irb/ruby-lex.rb:123: warning: previous definition of ERROR_TOKENS was here"
are printed.

The warnings can be observed when invoking irb by calling `binding.irb` from
Ruby code.

$ echo "" | ruby -e binding.irb

Actual results:

~~~
/usr/share/ruby/irb/ruby-lex.rb:123: warning: already initialized constant RubyLex::ERROR_TOKENS
/usr/share/gems/gems/irb-1.3.5/lib/irb/ruby-lex.rb:123: warning: previous definition of ERROR_TOKENS was here
/usr/share/ruby/irb/color.rb:8: warning: already initialized constant IRB::Color::CLEAR
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:8: warning: previous definition of CLEAR was here
/usr/share/ruby/irb/color.rb:9: warning: already initialized constant IRB::Color::BOLD
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:9: warning: previous definition of BOLD was here
/usr/share/ruby/irb/color.rb:10: warning: already initialized constant IRB::Color::UNDERLINE
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:10: warning: previous definition of UNDERLINE was here
/usr/share/ruby/irb/color.rb:11: warning: already initialized constant IRB::Color::REVERSE
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:11: warning: previous definition of REVERSE was here
/usr/share/ruby/irb/color.rb:12: warning: already initialized constant IRB::Color::RED
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:12: warning: previous definition of RED was here
/usr/share/ruby/irb/color.rb:13: warning: already initialized constant IRB::Color::GREEN
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:13: warning: previous definition of GREEN was here
/usr/share/ruby/irb/color.rb:14: warning: already initialized constant IRB::Color::YELLOW
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:14: warning: previous definition of YELLOW was here
/usr/share/ruby/irb/color.rb:15: warning: already initialized constant IRB::Color::BLUE
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:15: warning: previous definition of BLUE was here
/usr/share/ruby/irb/color.rb:16: warning: already initialized constant IRB::Color::MAGENTA
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:16: warning: previous definition of MAGENTA was here
/usr/share/ruby/irb/color.rb:17: warning: already initialized constant IRB::Color::CYAN
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:17: warning: previous definition of CYAN was here
/usr/share/ruby/irb/color.rb:19: warning: already initialized constant IRB::Color::TOKEN_KEYWORDS
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:19: warning: previous definition of TOKEN_KEYWORDS was here
/usr/share/ruby/irb/color.rb:26: warning: already initialized constant IRB::Color::ALL
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:26: warning: previous definition of ALL was here
/usr/share/ruby/irb/color.rb:32: warning: already initialized constant IRB::Color::TOKEN_SEQ_EXPRS
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:32: warning: previous definition of TOKEN_SEQ_EXPRS was here
/usr/share/ruby/irb/color.rb:75: warning: already initialized constant IRB::Color::ERROR_TOKENS
/usr/share/gems/gems/irb-1.3.5/lib/irb/color.rb:75: warning: previous definition of ERROR_TOKENS was here
Switch to inspect mode.
~~~

Expected results:

No warning

Patching the requires inside rubygem-irb to use `require_relative`
instead resolves the situation.

Patch composed from:
https://github.com/ruby/irb/pull/335
848d339f2e
https://github.com/ruby/irb/pull/336
d5060f7668
https://github.com/ruby/irb/pull/338
99d3aa979d

Resolves: RHEL-83044
2025-03-27 15:03:49 +01:00
.gitlab/merge_request_templates Add a merge-request (pull-request, PR) template to communicate more on a PR. 2022-08-16 17:25:30 +00:00
.gitignore .gitignore: Remove the setting to ignore any directories. 2022-08-16 17:25:30 +00:00
gating.yaml Add gating.yaml based on baseosci results 2022-02-14 08:40:39 +00:00
libruby.stp RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
macros.ruby RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
macros.rubygems Pass ldflags to gem install 2021-08-19 16:24:37 +02:00
operating_system.rb RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
ruby-1.9.3-mkmf-verbose.patch RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
ruby-2.1.0-always-use-i386.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-2.1.0-custom-rubygems-location.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-2.1.0-Enable-configuration-of-archlibdir.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-2.3.0-ruby_version.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-2.7.0-Initialize-ABRT-hook.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch Merged update from upstream sources 2021-01-08 15:41:21 +00:00
ruby-3.1.0-Add-more-support-for-generic-pkey-types.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-addr2line-DW_FORM_ref_addr.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Allocate-EVP_PKEY-on-initialize.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Allow-setting-algorithm-specific-options-in-sign-and-verify.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Deprecate-PKey-set_-and-PKey-DH-EC-generate_key.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Disable-test_no_private_exp-on-OpenSSL-3.0.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Don-t-query-RubyVM-FrozenCore-for-class-path.patch Prevent segfaults running with SystemTap. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Get-rid-of-type-punning-pointer-casts.patch Adjust existing patch files to suppress Hunk lines. 2023-06-28 14:53:08 +02:00
ruby-3.1.0-Ignore-DW_FORM_ref_addr.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Implement-PKey-encrypt-decrypt-sign_raw-verify_raw-and-verify_recover.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Migrate-from-the-low-level-HMAC-API-to-the-EVP-API.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.1.0-Miscellaneous-changes-for-OpenSSL-3.0-support-part-2.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Miscellaneous-changes-for-OpenSSL-3.0-support.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.1.0-Properly-exclude-test-cases.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Refactor-PEM-DER-serialization-code.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Support-GCCs-DWARF-5.patch Upgrade to Ruby 3.0.3. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_digest-do-not-test-constants-for-l.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_pkcs12-fix-test-failures-with-Open.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_pkey-use-EC-keys-for-PKey.generate.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-test_ssl-relax-regex-to-match-OpenSSL-s.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-test-openssl-utils-remove-dup_public-helper-method.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.0-Use-EVP-API-in-more-places.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.1.0-Use-high-level-EVP-interface-to-generate-parameters-and-keys.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.1.0-Use-mmap-for-allocating-heap-pages-in-the-GC.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.1.0-Use-OSSL_DECODER-to-load-encrypted-PEM-on-OpenSSL-3.0.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
ruby-3.1.1-ossl_ocsp-use-null.patch OpenSSL test suite fixes due to disabled SHA1. 2022-08-03 10:11:30 +02:00
ruby-3.1.2-ossl-tests-replace-sha1.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.2.0-define-unsupported-gc-compaction-methods_generated-files.patch Undefine GC compaction and related methods for ppc64le. 2025-03-27 15:03:49 +01:00
ruby-3.2.0-define-unsupported-gc-compaction-methods-as-rb_f_notimplement.patch Undefine GC compaction and related methods for ppc64le. 2025-03-27 15:03:49 +01:00
ruby-3.2.0-Detect-compaction-support-during-runtime.patch Undefine GC compaction and related methods for ppc64le. 2025-03-27 15:03:49 +01:00
ruby-3.3.0-openssl-3.2.0-fips-enable-tests.patch Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
ruby-3.3.0-openssl-3.2.0-fips-fix-pkey-dh-require-openssl.patch ssl: use ffdhe2048 from RFC 7919 as the default DH group parameter 2023-10-16 16:17:50 +02:00
ruby-3.3.0-openssl-3.2.0-fips-fix-pkey-read-in-openssl-3.patch Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
ruby-3.3.0-openssl-3.2.0-fix-fips-get-set-in-openssl-3.patch Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
ruby-3.3.0-test-file-utime.patch Fix File.utime test. 2023-06-28 22:15:41 +02:00
ruby-3.3.1-Fix-test-session-reuse-but-expire.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-3.4.0-ruby-net-http-Renew-test-certificates.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-exercise.stp RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
ruby-ext-openssl-extconf.rb-ignore-OpenSSL-version-check.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby-spec-Fix-tests-on-tzdata-2022b.patch Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
ruby.rpmlintrc Additional enhancement changes 2021-08-19 16:24:37 +02:00
ruby.spec Fix printing warnings when using IRB from a script. 2025-03-27 15:03:49 +01:00
rubygem-irb-1.4.2-Fix-already-initialized-constant-messages-from-require-in-scripts.patch Fix printing warnings when using IRB from a script. 2025-03-27 15:03:49 +01:00
rubygem-rexml-3.3.9-Fix-ReDoS-CVE-2024-49761.patch Fix REXML ReDoS vulnerability. (CVE-2024-49761) 2024-12-02 16:17:33 +01:00
rubygems-3.2.30-Provide-distinguished-name-which-will-be-correctly-p.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
rubygems-3.2.33-Fix-loading-operating_system-rb-customizations-too-late.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
rubygems-3.3.1-Fix-compatibility-with-OpenSSL3.0.patch Update OpenSSL 3 compatibility patches. 2022-02-11 13:52:42 +01:00
rubygems.attr RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
rubygems.con RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
rubygems.prov RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
rubygems.req RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
sources Upgrade to Ruby 3.0.7. 2024-05-13 14:23:34 +02:00
test_abrt.rb RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00
test_openssl_fips.rb Fix OpenSSL.fips_mode and OpenSSL::PKey.read in OpenSSL 3 FIPS. 2023-10-13 13:23:14 +02:00
test_systemtap.rb RHEL 9.0.0 Alpha bootstrap 2020-10-14 21:55:41 -07:00