mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
refactor: use ternary operator for readability
This commit is contained in:
+1
-5
@@ -60,11 +60,7 @@ module MRuby
|
||||
def mruby_config_path
|
||||
path = ENV['MRUBY_CONFIG'] || ENV['CONFIG']
|
||||
if path.nil? || path.empty?
|
||||
if File.file?("./build_config.rb")
|
||||
path = "./build_config.rb"
|
||||
else
|
||||
path = "#{MRUBY_ROOT}/build_config/default.rb"
|
||||
end
|
||||
path = File.file?("./build_config.rb") ? "./build_config.rb" : "#{MRUBY_ROOT}/build_config/default.rb"
|
||||
elsif !File.file?(path) && !Pathname.new(path).absolute?
|
||||
f = "#{MRUBY_ROOT}/build_config/#{path}.rb"
|
||||
path = File.exist?(f) ? f : File.extname(path).empty? ? f : path
|
||||
|
||||
Reference in New Issue
Block a user