Class: Gemkeeper::ManifestValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/gemkeeper/manifest_validator.rb

Overview

Validates a manifest file structurally and, optionally, by probing git remotes.

Constant Summary collapse

VALID_GIT_URL =
%r{\A(git@|https?://|ssh://)}
VALID_HTTP_URL =
%r{\Ahttps?://}
RESOLVE_TIMEOUT =
5

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ ManifestValidator

Returns a new instance of ManifestValidator.



14
15
16
# File 'lib/gemkeeper/manifest_validator.rb', line 14

def initialize(path)
  @path = path
end

Instance Method Details

#validate(resolve: false, output: $stdout) ⇒ Object



18
19
20
21
22
23
# File 'lib/gemkeeper/manifest_validator.rb', line 18

def validate(resolve: false, output: $stdout)
  errors = static_errors
  return errors if errors.any?

  errors + (resolve ? resolve_errors(output) : [])
end