Class: Spring::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/spring/env.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnv

Returns a new instance of Env.



11
12
13
# File 'lib/spring/env.rb', line 11

def initialize
  @root = Pathname.new(File.expand_path('.'))
end

Instance Attribute Details

#rootObject (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_pathObject



29
30
31
# File 'lib/spring/env.rb', line 29

def pidfile_path
  tmp_path.join("#{SID.sid}.pid")
end

#socket_nameObject



25
26
27
# File 'lib/spring/env.rb', line 25

def socket_name
  socket_path.to_s
end

#socket_pathObject



21
22
23
# File 'lib/spring/env.rb', line 21

def socket_path
  tmp_path.join(SID.sid.to_s)
end

#tmp_pathObject



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