Class: Rucola::InfoPlist
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #add_document_type(name, extension, role, icon = '????', os_type = '????') ⇒ Object
-
#app_name ⇒ Object
Returns the name of the application (CFBundleExecutable).
- #document_types ⇒ Object
-
#initialize(path) ⇒ InfoPlist
constructor
A new instance of InfoPlist.
- #save ⇒ Object
Constructor Details
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/rucola/info_plist.rb', line 9 def data @data end |
Class Method Details
.open(path) ⇒ Object
5 6 7 |
# File 'lib/rucola/info_plist.rb', line 5 def self.open(path) new(path) end |
Instance Method Details
#add_document_type(name, extension, role, icon = '????', os_type = '????') ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rucola/info_plist.rb', line 21 def add_document_type(name, extension, role, icon = '????', os_type = '????') document_types.push({ 'NSDocumentClass' => name, 'CFBundleTypeExtensions' => [extension], 'CFBundleTypeRole' => role, 'CFBundleTypeIconFile' => icon, 'CFBundleTypeOSTypes' => [os_type], 'CFBundleTypeName' => 'DocumentType' }) end |
#app_name ⇒ Object
Returns the name of the application (CFBundleExecutable).
37 38 39 |
# File 'lib/rucola/info_plist.rb', line 37 def app_name @data['CFBundleExecutable'].to_s end |
#document_types ⇒ Object
16 17 18 19 |
# File 'lib/rucola/info_plist.rb', line 16 def document_types @data['CFBundleDocumentTypes'] ||= [] @data['CFBundleDocumentTypes'] end |
#save ⇒ Object
32 33 34 |
# File 'lib/rucola/info_plist.rb', line 32 def save @data.writeToFile_atomically(@path, true) end |