Skip to content

Commit 7751b12

Browse files
committed
Display the offending parent path in the exception
1 parent a23e63f commit 7751b12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/tmpdir.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ def self.mktmpdir(prefix_suffix=nil, *rest, **options)
107107
yield path.dup
108108
ensure
109109
unless base
110-
stat = File.stat(File.dirname(path))
110+
base = File.dirname(path)
111+
stat = File.stat(base)
111112
if stat.world_writable? and !stat.sticky?
112-
raise ArgumentError, "parent directory is world writable but not sticky"
113+
raise ArgumentError, "parent directory is world writable but not sticky: #{base}"
113114
end
114115
end
115116
FileUtils.remove_entry path

0 commit comments

Comments
 (0)