Class: Composer::Verify::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/composer/verify/secret.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Secret

Returns a new instance of Secret.



5
6
7
8
# File 'lib/composer/verify/secret.rb', line 5

def initialize(args)
  @config = args[:config]
  @logger = @config.logger
end

Instance Method Details

#verify(args) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/composer/verify/secret.rb', line 10

def verify(args)
  secret = args[:secret]

  if secret.length < 8
    raise InvalidSecret.new "'#{secret}' must be at least 8 characters"
  end

  @logger.info "Application secret '#{secret}' is valid."
end