Class: Wrapp::AppInfo
- Inherits:
-
Object
- Object
- Wrapp::AppInfo
- Defined in:
- lib/wrapp/app_info.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #full_name ⇒ Object
- #get_property(property) ⇒ Object
-
#initialize(path) ⇒ AppInfo
constructor
A new instance of AppInfo.
- #name ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(path) ⇒ AppInfo
Returns a new instance of AppInfo.
5 6 7 |
# File 'lib/wrapp/app_info.rb', line 5 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/wrapp/app_info.rb', line 3 def path @path end |
Instance Method Details
#full_name ⇒ Object
9 10 11 12 |
# File 'lib/wrapp/app_info.rb', line 9 def full_name separator = '_' [name.downcase, version].join(separator).gsub(/\s+/, separator) end |
#get_property(property) ⇒ Object
22 23 24 25 26 |
# 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 ⇒ Object
14 15 16 |
# File 'lib/wrapp/app_info.rb', line 14 def name get_property('CFBundleName') end |
#version ⇒ Object
18 19 20 |
# File 'lib/wrapp/app_info.rb', line 18 def version get_property('CFBundleShortVersionString') end |