class Wrapp::AppInfo
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/wrapp/app_info.rb, line 5 def initialize(path) @path = path end
Public Instance Methods
full_name()
click to toggle source
# File lib/wrapp/app_info.rb, line 9 def full_name separator = '_' [name.downcase, version].join(separator).gsub(/\s+/, separator) end
get_property(property)
click to toggle source
# File lib/wrapp/app_info.rb, line 22 def get_property(property) output = `/usr/libexec/PlistBuddy -c 'Print :#{property}' '#{plist}'` raise "Error reading #{property} from #{plist}" unless $?.success? output.strip end
name()
click to toggle source
# File lib/wrapp/app_info.rb, line 14 def name get_property('CFBundleName') end
version()
click to toggle source
# File lib/wrapp/app_info.rb, line 18 def version get_property('CFBundleShortVersionString') end
Private Instance Methods
plist()
click to toggle source
# File lib/wrapp/app_info.rb, line 30 def plist File.join(path, 'Contents', 'Info.plist') end