Skip to content

Commit b3038d4

Browse files
committed
refactor: use ternary operator for readability
1 parent 501c237 commit b3038d4

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

lib/mruby/build.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ class << self
6060
def mruby_config_path
6161
path = ENV['MRUBY_CONFIG'] || ENV['CONFIG']
6262
if path.nil? || path.empty?
63-
if File.file?("./build_config.rb")
64-
path = "./build_config.rb"
65-
else
66-
path = "#{MRUBY_ROOT}/build_config/default.rb"
67-
end
63+
path = File.file?("./build_config.rb") ? "./build_config.rb" : "#{MRUBY_ROOT}/build_config/default.rb"
6864
elsif !File.file?(path) && !Pathname.new(path).absolute?
6965
f = "#{MRUBY_ROOT}/build_config/#{path}.rb"
7066
path = File.exist?(f) ? f : File.extname(path).empty? ? f : path

0 commit comments

Comments
 (0)