Class: XcodeTool::PlistBuddy

Inherits:
Object
  • Object
show all
Defined in:
lib/bean/xcode_tool.rb

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ PlistBuddy

Returns a new instance of PlistBuddy.



6
7
8
# File 'lib/bean/xcode_tool.rb', line 6

def initialize(file)
  @plist_file = file
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



14
15
16
17
18
19
# File 'lib/bean/xcode_tool.rb', line 14

def method_missing(m, *args) 
  # puts "PlistBuddy call #{m.to_s}, args: #{args}"
  # return unless m.to_s.include?('=')
  key = m.to_s
  format_plist(key, args)
end

Instance Method Details

#exit?(key) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/bean/xcode_tool.rb', line 21

def exit?(key)
  system "/usr/libexec/PlistBuddy -c 'Print :#{key}' #{@plist_file} > /dev/null 2>&1"
end