Skip to content

Commit 9e8ac14

Browse files
committed
ENV["HOME"] and Dir.home seems not to be equivalent
because Ruby 2.5 CI passes with the former but fails with the latter. I don't want to introduce any new bug just for conforming RuboCop, so let me disable the cop and revert the code back to what used to work. This reverts 862c937 and partially reverts 4480718.
1 parent 98f7382 commit 9e8ac14

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ Style/DocumentDynamicEvalDefinition:
239239
Style/EndlessMethod:
240240
Enabled: true
241241

242+
Style/EnvHome:
243+
Enabled: false
244+
242245
Style/ExplicitBlockArgument:
243246
# capturing as a proc has a performance hit, so is a case by case choice
244247
Enabled: false

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 = Dir.home || File.expand_path("~") || Etc.getpwuid.dir || (ENV.fetch("USER", nil) && File.expand_path("~#{ENV.fetch('USER', nil)}"))
4+
home_dir = (ENV["HOME"] && File.expand_path("~")) || Etc.getpwuid.dir || (ENV["USER"] && File.expand_path("~#{ENV['USER']}"))
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)