Module: Plview

Defined in:
lib/plview.rb,
lib/plview/version.rb

Constant Summary collapse

BASE =
"#{ENV['HOME']}/Library/Application\ Support/iPhone\ Simulator/"
VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#apps(version) ⇒ Object



31
32
33
34
35
36
# 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) ⇒ Object



38
39
40
41
42
43
# 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

#versionsObject



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