Class: SecretsCli::Check::Secrets

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/secrets_cli/check/secrets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#config, #error, #error!, #pastel, #pretty_diff, #print_verbose, #prompt

Constructor Details

#initialize(action, options) ⇒ Secrets

Returns a new instance of Secrets.



9
10
11
12
# File 'lib/secrets_cli/check/secrets.rb', line 9

def initialize(action, options)
  @action = action
  @options = options
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



6
7
8
# File 'lib/secrets_cli/check/secrets.rb', line 6

def action
  @action
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/secrets_cli/check/secrets.rb', line 7

def options
  @options
end

Instance Method Details

#callObject



14
15
16
17
18
# File 'lib/secrets_cli/check/secrets.rb', line 14

def call
  error! 'Missing .secrets' unless File.exist?('.secrets')
  error! 'Missing secrets_file' if require_secrets_file? && missing_secret_file?
  error! 'Missing secrets_storage_key' if missing_secret_storage_key?
end