module Plister

Constants

VERSION

Public Class Methods

preferences(path = nil) click to toggle source
# File lib/plister.rb, line 12
def preferences(path = nil)
  Plister::Preferences.new(path)
end
user() click to toggle source
# File lib/plister.rb, line 16
def user
  @user ||= begin
    user = `whoami`.strip
    return user unless user == 'root'
    `logname`.strip
  end
end
uuid() click to toggle source
# File lib/plister.rb, line 24
def uuid
  @uuid ||= begin
    uuid = `ioreg -rd1 -c IOPlatformExpertDevice`
    matches = uuid.match(/"IOPlatformUUID" = "([0-9A-F-]{36})"/)
    matches[1] if matches
  end
end