Skip to content

Commit cbdf05e

Browse files
committed
rubocop -a --only Style/FetchEnvVar
1 parent 9e8ac14 commit cbdf05e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/simplecov/load_global_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require "etc"
4-
home_dir = (ENV["HOME"] && File.expand_path("~")) || Etc.getpwuid.dir || (ENV["USER"] && File.expand_path("~#{ENV['USER']}"))
4+
home_dir = (ENV.fetch("HOME", nil) && File.expand_path("~")) || Etc.getpwuid.dir || (ENV.fetch("USER", nil) && File.expand_path("~#{ENV.fetch('USER', nil)}"))
55
if home_dir
66
global_config_path = File.join(home_dir, ".simplecov")
77
load global_config_path if File.exist?(global_config_path)

0 commit comments

Comments
 (0)