Class: LicenseScout::DependencyManager::Glide

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

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


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

def dependencies
  # We cannot use YAML.safe_load because Psych throws a fit about the
  # updated field. We should circle back and see what we can do to fix that.
  YAML.load(File.read(glide_lock_path))["imports"].map do |import|
    dep_name = import["name"]
    dep_version = import["version"]
    dep_path = gopath(dep_name)

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

#detected?Boolean

Returns:

  • (Boolean)

40
41
42
# File 'lib/license_scout/dependency_manager/glide.rb', line 40

def detected?
  File.exist?(glide_lock_path)
end

#install_commandObject


36
37
38
# File 'lib/license_scout/dependency_manager/glide.rb', line 36

def install_command
  "glide install"
end

#nameObject


24
25
26
# File 'lib/license_scout/dependency_manager/glide.rb', line 24

def name
  "golang_glide"
end

#signatureObject


32
33
34
# File 'lib/license_scout/dependency_manager/glide.rb', line 32

def signature
  "glide.lock file"
end

#typeObject


28
29
30
# File 'lib/license_scout/dependency_manager/glide.rb', line 28

def type
  "golang"
end