module StateMate::Adapters::TimeMachine
Constants
- EXE
- PLIST_PATH
Public Class Methods
disable_local()
click to toggle source
# File lib/state_mate/adapters/time_machine.rb, line 33 def self.disable_local Cmds.out! "%{exe} disablelocal", exe: EXE end
enable_local()
click to toggle source
# File lib/state_mate/adapters/time_machine.rb, line 29 def self.enable_local Cmds.out! "%{exe} enablelocal", exe: EXE end
local_enabled?()
click to toggle source
# File lib/state_mate/adapters/time_machine.rb, line 19 def self.local_enabled? # seems to change the key # # /Library/Preferences/com.apple.TimeMachine.plist:MobileBackups # plist = CFPropertyList::List.new file: PLIST_PATH data = CFPropertyList.native_types plist.value data['MobileBackups'] end
read(key, options = {})
click to toggle source
# File lib/state_mate/adapters/time_machine.rb, line 37 def self.read key, options = {} case key when 'local_backups' local_enabled? else raise "bad key: #{ key.inspect }" end end
write(key, value, options = {})
click to toggle source
# File lib/state_mate/adapters/time_machine.rb, line 46 def self.write key, value, options = {} case key when 'local_backups' case value when true enable_local when false disable_local else raise "bad value: #{ value.inspect }" end else raise "bad key: #{ key.inspect }" end end