lib/simctl/device.rb in simctl-1.3.1 vs lib/simctl/device.rb in simctl-1.4.0
- old
+ new
@@ -1,8 +1,9 @@
require 'cfpropertylist'
require 'ostruct'
require 'simctl/device_path'
+require 'simctl/device_settings'
require 'simctl/object'
require 'timeout'
module SimCtl
class Device < Object
@@ -27,29 +28,16 @@
# @return [SimCtl::DeviceType]
def devicetype
@devicetype ||= SimCtl.devicetype(identifier: plist.deviceType)
end
+ # <b>DEPRECATED:</b> Please use <tt>device.settings.disable_keyboard_helpers!</tt> instead.
# Disables the keyboard helpers
#
# @return [void]
def disable_keyboard_helpers!
- path.edit path.preferences_plist do |plist|
- %w(
- KeyboardPeriodShortcut
- KeyboardAutocapitalization
- KeyboardCheckSpelling
- KeyboardAssistant
- KeyboardAutocorrection
- KeyboardPrediction
- KeyboardShowPredictionBar
- KeyboardCapsLock
- ).each do |key|
- plist[key] = false
- end
- plist
- end
+ settings.disable_keyboard_helpers!
end
# Erases the device
#
# @return [void]
@@ -92,9 +80,16 @@
# Resets the runtime
#
# @return [SimCtl::Runtime]
def runtime
@runtime ||= SimCtl.runtime(identifier: plist.runtime)
+ end
+
+ # Returns the settings object
+ #
+ # @ return [SimCtl::DeviceSettings]
+ def settings
+ @settings ||= DeviceSettings.new(path)
end
# Shuts down the runtime
#
# @return [void]