Class: LicenseScout::DependencyManager::Base
- Inherits:
-
Object
- Object
- LicenseScout::DependencyManager::Base
- Defined in:
- lib/license_scout/dependency_manager/base.rb
Direct Known Subclasses
Berkshelf, Bundler, Cargo, Cpanm, Dep, Glide, Godep, Gomod, Habitat, Mix, Npm, Rebar
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
Instance Method Summary collapse
-
#dependencies ⇒ Array<LicenseScout::Dependency>
Implementation’s of this method in sub-classes are the methods that are responsible for all the heavy-lifting when it comes to determining the dependencies (and their licenses).
-
#detected? ⇒ Boolean
Whether or not we were able to detect that this dependency manager is currently in use in our directory.
-
#initialize(directory) ⇒ Base
constructor
A new instance of Base.
-
#install_command ⇒ String
The command to run to install dependency if one or more is missing.
-
#name ⇒ String
The unique name of this Dependency Manager.
-
#signature ⇒ String
A human-readable description of the files/folders that indicate this dependency manager is in use.
-
#type ⇒ String
The “type” of dependencies this manager manages.
Constructor Details
#initialize(directory) ⇒ Base
Returns a new instance of Base.
42 43 44 45 |
# File 'lib/license_scout/dependency_manager/base.rb', line 42 def initialize(directory) @directory = directory @deps = nil end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
39 40 41 |
# File 'lib/license_scout/dependency_manager/base.rb', line 39 def directory @directory end |
Instance Method Details
#dependencies ⇒ Array<LicenseScout::Dependency>
Implementation’s of this method in sub-classes are the methods that are responsible for all the heavy-lifting when it comes to determining the dependencies (and their licenses). They should return an array of ‘LicenseScout::Dependency`.
97 98 99 |
# File 'lib/license_scout/dependency_manager/base.rb', line 97 def dependencies [] end |
#detected? ⇒ Boolean
Whether or not we were able to detect that this dependency manager is currently in use in our directory
81 82 83 |
# File 'lib/license_scout/dependency_manager/base.rb', line 81 def detected? raise LicenseScout::Exceptions::Error.new("All DependencyManagers must have a `#detected?` method") end |
#install_command ⇒ String
The command to run to install dependency if one or more is missing
88 89 90 |
# File 'lib/license_scout/dependency_manager/base.rb', line 88 def install_command raise LicenseScout::Exceptions::Error.new("All DependencyManagers must have a `#install_command` method") end |
#name ⇒ String
The unique name of this Dependency Manager. In general, the name should follow the ‘<TYPE>_<NAME` pattern where:
* <TYPE> is the value of DependencyManager#type
* <NAME> is the name of the dependency manager.
60 61 62 |
# File 'lib/license_scout/dependency_manager/base.rb', line 60 def name raise LicenseScout::Exceptions::Error.new("All DependencyManagers must have a `#name` method") end |
#signature ⇒ String
A human-readable description of the files/folders that indicate this dependency manager is in use.
74 75 76 |
# File 'lib/license_scout/dependency_manager/base.rb', line 74 def signature raise LicenseScout::Exceptions::Error.new("All DependencyManagers must have a `#signature` method") end |
#type ⇒ String
The “type” of dependencies this manager manages. This can be the language, tool, etc.
67 68 69 |
# File 'lib/license_scout/dependency_manager/base.rb', line 67 def type raise LicenseScout::Exceptions::Error.new("All DependencyManagers must have a `#type` method") end |