Class: MacSetup::SecretsInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/mac_setup/secrets_installer.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status) ⇒ SecretsInstaller

Returns a new instance of SecretsInstaller.



7
8
9
# File 'lib/mac_setup/secrets_installer.rb', line 7

def initialize(status)
  @status = status
end

Class Method Details

.run(_config, status) ⇒ Object



3
4
5
# File 'lib/mac_setup/secrets_installer.rb', line 3

def self.run(_config, status)
  new(status).run
end

Instance Method Details

#install_cryptoObject



16
17
18
# File 'lib/mac_setup/secrets_installer.rb', line 16

def install_crypto
  Shell.run("brew install #{SECRETS::CRYPTO_LIB}") unless @status.installed_formulas.include?(CRYPTO_LIB)
end

#runObject



11
12
13
14
# File 'lib/mac_setup/secrets_installer.rb', line 11

def run
  install_crypto
  Secrets.decrypt(@status.git_changes(:dotfiles))
end