Sha256: e94b18b4075cb8f389efc7eb759bdfa6fa6142e5ee782f49969541c7479d2031

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

require "pathname"
require "spring/sid"
require "fileutils"

class Spring
  class Env
    attr_reader :root

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

    def tmp_path
      path = root.join('tmp/spring')
      FileUtils.mkdir_p(path) unless path.exist?
      path
    end

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

    def socket_name
      socket_path.to_s
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spring-0.0.3 lib/spring/env.rb