Class: DependencyChecker::MetadataChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency_checker/metadata_checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(metadata, forge, updated_module, updated_module_version) ⇒ MetadataChecker

Returns a new instance of MetadataChecker.



8
9
10
11
12
13
# File 'lib/dependency_checker/metadata_checker.rb', line 8

def initialize(, forge, updated_module, updated_module_version)
  @metadata = 
  @forge = forge
  @updated_module = updated_module.sub('-', '/') if updated_module
  @updated_module_version = updated_module_version if updated_module_version
end

Instance Method Details

#check_dependenciesMap

Perform constraint comparisons of dependencies based on their latest version, and also override any occurance of @updated_module with @updated_module_version

Returns:

  • (Map)

    a map of dependencies along with their constraint, current version and whether they satisfy the constraint



18
19
20
21
22
23
24
# File 'lib/dependency_checker/metadata_checker.rb', line 18

def check_dependencies
  fetch_module_dependencies.map do |dependency, constraint|
    dependency = dependency.sub('-', '/')
    current = dependency == @updated_module ? SemanticPuppet::Version.parse(@updated_module_version) : @forge.get_current_version(dependency)
    [dependency, constraint, current, constraint.include?(current)]
  end
end