Class: LicenseScout::DependencyManager::Dep

Inherits:
Base
  • Object
show all
Defined in:
lib/license_scout/dependency_manager/dep.rb

Overview

dep(github.com/golang/dep) is a new dependency manger available from go 1.8

Instance Attribute Summary

Attributes inherited from Base

#directory

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LicenseScout::DependencyManager::Base

Instance Method Details

#dependenciesObject



45
46
47
48
49
50
51
52
53
# File 'lib/license_scout/dependency_manager/dep.rb', line 45

def dependencies
  Array(gopkg.dig("projects")).map do |pkg_info|
    dep_name = pkg_info["name"]
    dep_version = pkg_info["version"] || pkg_info["revision"]
    dep_path = package_path(dep_name)

    new_dependency(dep_name, dep_version, dep_path)
  end.compact
end

#detected?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/license_scout/dependency_manager/dep.rb', line 41

def detected?
  File.exist?(gopkg_lock_path)
end

#install_commandObject



37
38
39
# File 'lib/license_scout/dependency_manager/dep.rb', line 37

def install_command
  "dep ensure"
end

#nameObject



25
26
27
# File 'lib/license_scout/dependency_manager/dep.rb', line 25

def name
  "golang_dep"
end

#signatureObject



33
34
35
# File 'lib/license_scout/dependency_manager/dep.rb', line 33

def signature
  "Gopkg.lock file"
end

#typeObject



29
30
31
# File 'lib/license_scout/dependency_manager/dep.rb', line 29

def type
  "golang"
end