Method: RunLoop::PlistBuddy#run_command
- Defined in:
- lib/run_loop/plist_buddy.rb
#run_command(cmd, file, opts = {}) ⇒ Object
Sends an arbitrary command (-c) to PlistBuddy.
This class does not handle setting data, date, dictionary, or array or manipulating elements in existing array or dictionary types. This method is an attempt to bridge this gap.
When setting/adding bool, real, integer, string values, use #plist_set.
For reading values, use #plist_read.
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/run_loop/plist_buddy.rb', line 130 def run_command(cmd, file, opts={}) success, output = execute_plist_cmd(cmd, file, opts) if !success raise RuntimeError, %Q[ Encountered an error performing operation on plist: #{plist_buddy} -c "#{cmd}" #{file} => #{output} ] end return success, output end |