Skip to content

Commit 577cf01

Browse files
authored
Merge pull request #616 from deivid-rodriguez/lazily_load_tmpdir_and_fileutils
Lazily load fileutils and tmpdir
2 parents 24d9e93 + daa5096 commit 577cf01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/spring/env.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
require "pathname"
2-
require "fileutils"
32
require "digest/md5"
4-
require "tmpdir"
53

64
require "spring/version"
75
require "spring/sid"
@@ -33,10 +31,12 @@ def version
3331
end
3432

3533
def tmp_path
34+
require "tmpdir"
3635
path = Pathname.new(
3736
ENV["SPRING_TMP_PATH"] ||
3837
File.join(ENV['XDG_RUNTIME_DIR'] || Dir.tmpdir, "spring-#{Process.uid}")
3938
)
39+
require "fileutils"
4040
FileUtils.mkdir_p(path) unless path.exist?
4141
path
4242
end

0 commit comments

Comments
 (0)