Class: MacSetup::DefaultsInstaller
- Inherits:
-
Object
- Object
- MacSetup::DefaultsInstaller
- Defined in:
- lib/mac_setup/defaults_installer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(defaults_file, config, status) ⇒ DefaultsInstaller
constructor
A new instance of DefaultsInstaller.
- #run ⇒ Object
Constructor Details
#initialize(defaults_file, config, status) ⇒ DefaultsInstaller
Returns a new instance of DefaultsInstaller.
14 15 16 17 18 |
# File 'lib/mac_setup/defaults_installer.rb', line 14 def initialize(defaults_file, config, status) @defaults = YAML.load_file(defaults_file) @config = config @status = status end |
Class Method Details
.run(config, status) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/mac_setup/defaults_installer.rb', line 3 def self.run(config, status) defaults_file = File.join(MacSetup.dotfiles_path, "mac_setup/defaults.yml") if File.exist?(defaults_file) MacSetup.log "Setting defaults..." new(defaults_file, config, status).run else MacSetup.log "No config file at #{MacSetup.shorten_path(defaults_file)}. Skipping..." end end |