Module: Plister

Defined in:
lib/plister.rb,
lib/plister/plist.rb,
lib/plister/version.rb,
lib/plister/exporter.rb,
lib/plister/preferences.rb

Defined Under Namespace

Classes: Exporter, Plist, Preferences

Constant Summary collapse

VERSION =
'0.2.0'.freeze

Class Method Summary collapse

Class Method Details

.preferences(path = nil) ⇒ Object



12
13
14
# File 'lib/plister.rb', line 12

def preferences(path = nil)
  Plister::Preferences.new(path)
end

.userObject



16
17
18
19
20
21
22
# File 'lib/plister.rb', line 16

def user
  @user ||= begin
    user = `whoami`.strip
    return user unless user == 'root'
    `logname`.strip
  end
end

.uuidObject



24
25
26
27
28
29
30
# 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