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.
8 9 10 |
# File 'lib/spring/env.rb', line 8 def initialize @root = Pathname.new(File.('.')) end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
6 7 8 |
# File 'lib/spring/env.rb', line 6 def root @root end |
Instance Method Details
#pidfile_path ⇒ Object
26 27 28 |
# File 'lib/spring/env.rb', line 26 def pidfile_path tmp_path.join("#{SID.sid}.pid") end |
#socket_name ⇒ Object
22 23 24 |
# File 'lib/spring/env.rb', line 22 def socket_name socket_path.to_s end |
#socket_path ⇒ Object
18 19 20 |
# File 'lib/spring/env.rb', line 18 def socket_path tmp_path.join(SID.sid.to_s) end |
#tmp_path ⇒ Object
12 13 14 15 16 |
# File 'lib/spring/env.rb', line 12 def tmp_path path = root.join('tmp/spring') path.mkdir unless path.exist? path end |