Sha256: a63beb720ff14b3d1627b8b841e537eeea3fd4ab4862beab60c3381f73cd4271

Contents?: true

Size: 443 Bytes

Versions: 3

Compression:

Stored size: 443 Bytes

Contents

require 'fileutils'

module Eye::Settings

  module_function
  
  def dir
    if Process::UID.eid == 0 # root
      '/var/run/eye'
    else
      File.expand_path(File.join(ENV['HOME'], '.eye'))
    end    
  end
  
  def path(path)
    File.join(dir, path)
  end

  def ensure_eye_dir
    FileUtils.mkdir_p( dir )
  end

  def socket_path
    path('sock')
  end
  
  def pid_path
    path('pid')
  end
  
  def client_timeout
    5
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eye-0.2.1 lib/eye/settings.rb
eye-0.2 lib/eye/settings.rb
eye-0.1.11 lib/eye/settings.rb