Skip to content

Commit e30eee6

Browse files
committed
Fix Spring::Env so it works in tests
1 parent ba526bc commit e30eee6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/spring/env.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ class Env
1414
attr_reader :log_file
1515

1616
def initialize(root = nil)
17-
@root = root
18-
@log_file = File.open(ENV["SPRING_LOG"] || "/dev/null", "a")
17+
@root = root
18+
@project_root = root
19+
@log_file = File.open(ENV["SPRING_LOG"] || "/dev/null", "a")
1920
end
2021

2122
def root
2223
@root ||= Spring.application_root_path
2324
end
2425

26+
def project_root
27+
@project_root ||= Spring.project_root_path
28+
end
29+
2530
def version
2631
Spring::VERSION
2732
end
@@ -33,7 +38,7 @@ def tmp_path
3338
end
3439

3540
def application_id
36-
Digest::MD5.hexdigest(Spring.project_root_path.to_s)
41+
Digest::MD5.hexdigest(project_root.to_s)
3742
end
3843

3944
def socket_path

0 commit comments

Comments
 (0)