Class: Spring::Env
- Inherits:
-
Object
- Object
- Spring::Env
- Defined in:
- lib/spring/env.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize ⇒ Env
constructor
A new instance of Env.
- #pidfile_path ⇒ Object
- #socket_name ⇒ Object
- #socket_path ⇒ Object
- #tmp_path ⇒ Object
Constructor Details
#initialize ⇒ Env
Returns a new instance of Env.
11 12 13 |
# File 'lib/spring/env.rb', line 11 def initialize @root = Pathname.new(File.('.')) end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
9 10 11 |
# File 'lib/spring/env.rb', line 9 def root @root end |
Instance Method Details
#pidfile_path ⇒ Object
29 30 31 |
# File 'lib/spring/env.rb', line 29 def pidfile_path tmp_path.join("#{SID.sid}.pid") end |
#socket_name ⇒ Object
25 26 27 |
# File 'lib/spring/env.rb', line 25 def socket_name socket_path.to_s end |
#socket_path ⇒ Object
21 22 23 |
# File 'lib/spring/env.rb', line 21 def socket_path tmp_path.join(SID.sid.to_s) end |
#tmp_path ⇒ Object
15 16 17 18 19 |
# File 'lib/spring/env.rb', line 15 def tmp_path path = root.join('tmp/spring') FileUtils.mkdir_p(path) unless path.exist? path end |