From daa5096c0de3d0c8ea57690bb165e1df814915cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 10 Jun 2020 15:43:29 +0200 Subject: [PATCH] Lazily load fileutils and tmpdir --- lib/spring/env.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spring/env.rb b/lib/spring/env.rb index ed895b80..e22b70ab 100644 --- a/lib/spring/env.rb +++ b/lib/spring/env.rb @@ -1,7 +1,5 @@ require "pathname" -require "fileutils" require "digest/md5" -require "tmpdir" require "spring/version" require "spring/sid" @@ -33,10 +31,12 @@ def version end def tmp_path + require "tmpdir" path = Pathname.new( ENV["SPRING_TMP_PATH"] || File.join(ENV['XDG_RUNTIME_DIR'] || Dir.tmpdir, "spring-#{Process.uid}") ) + require "fileutils" FileUtils.mkdir_p(path) unless path.exist? path end