Consistently use HOMEBREW_RUBY_WARNINGS when calling ruby

Adding this in `dev-cmd/ruby.rb` allows us to suppress warnings like:
```
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/language/python.rb:8: warning: Insecure world writable dir /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/scm in PATH, mode 040777
```
This commit is contained in:
Dawid Dziurla 2020-08-20 13:09:18 +02:00
parent dd71f388c1
commit c8c2e38bcb
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B
5 changed files with 6 additions and 5 deletions

View File

@ -30,6 +30,7 @@ module Homebrew
begin begin
safe_system RUBY_PATH, safe_system RUBY_PATH,
ENV["HOMEBREW_RUBY_WARNINGS"],
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR), "-I", $LOAD_PATH.join(File::PATH_SEPARATOR),
"-rglobal", "-rdev-cmd/irb", "-rglobal", "-rdev-cmd/irb",
*ruby_sys_args *ruby_sys_args

View File

@ -78,7 +78,7 @@ module Homebrew
begin begin
exec_args = %W[ exec_args = %W[
#{RUBY_PATH} #{RUBY_PATH}
-W0 #{ENV["HOMEBREW_RUBY_WARNINGS"]}
-I #{$LOAD_PATH.join(File::PATH_SEPARATOR)} -I #{$LOAD_PATH.join(File::PATH_SEPARATOR)}
-- --
#{HOMEBREW_LIBRARY_PATH}/test.rb #{HOMEBREW_LIBRARY_PATH}/test.rb

View File

@ -15,7 +15,7 @@ class FormulaInfo
def self.lookup(name) def self.lookup(name)
json = Utils.popen_read( json = Utils.popen_read(
RUBY_PATH, RUBY_PATH,
"-W0", ENV["HOMEBREW_RUBY_WARNINGS"],
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR), "-I", $LOAD_PATH.join(File::PATH_SEPARATOR),
HOMEBREW_LIBRARY_PATH/"brew.rb", HOMEBREW_LIBRARY_PATH/"brew.rb",
"info", "info",

View File

@ -798,7 +798,7 @@ class FormulaInstaller
# the easiest way to do this # the easiest way to do this
args = %W[ args = %W[
nice #{RUBY_PATH} nice #{RUBY_PATH}
-W0 #{ENV["HOMEBREW_RUBY_WARNINGS"]}
-I #{$LOAD_PATH.join(File::PATH_SEPARATOR)} -I #{$LOAD_PATH.join(File::PATH_SEPARATOR)}
-- --
#{HOMEBREW_LIBRARY_PATH}/build.rb #{HOMEBREW_LIBRARY_PATH}/build.rb
@ -966,7 +966,7 @@ class FormulaInstaller
def post_install def post_install
args = %W[ args = %W[
nice #{RUBY_PATH} nice #{RUBY_PATH}
-W0 #{ENV["HOMEBREW_RUBY_WARNINGS"]}
-I #{$LOAD_PATH.join(File::PATH_SEPARATOR)} -I #{$LOAD_PATH.join(File::PATH_SEPARATOR)}
-- --
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb #{HOMEBREW_LIBRARY_PATH}/postinstall.rb

View File

@ -84,7 +84,7 @@ RSpec.shared_context "integration test" do
@ruby_args ||= begin @ruby_args ||= begin
ruby_args = [ ruby_args = [
"-W0", ENV["HOMEBREW_RUBY_WARNINGS"],
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR) "-I", $LOAD_PATH.join(File::PATH_SEPARATOR)
] ]
if ENV["HOMEBREW_TESTS_COVERAGE"] if ENV["HOMEBREW_TESTS_COVERAGE"]