module Plview

Constants

BASE
VERSION

Public Instance Methods

apps(version) click to toggle source
# File lib/plview.rb, line 31
def apps(version)
  @apps ||= Dir.glob("#{BASE}#{version}/Applications/**/*.app").inject({}) do |hash, path|
    hash[File.basename(path).sub(/.app/, '')] = File.dirname(path)
    hash
  end
end
plists(path) click to toggle source
# File lib/plview.rb, line 38
def plists(path)
  @plists ||= Dir.glob("#{path}/Library/Preferences/*.plist").reject {|path| path =~ /PeoplePicker/ }.inject({}) do |hash, path|
    hash[File.basename(path)] = CFPropertyList::List.new(file: path)
    hash
  end
end
versions() click to toggle source
# File lib/plview.rb, line 24
def versions
  @versions ||= Dir.glob(BASE + '*').reject {|path| path =~ /User$/ }.inject({}) {|hash, path|
    hash[path.sub(BASE, '')] = path
    hash
  }
end