class Licensed::Sources::Gradle::Dependency
Public Class Methods
Source
# File lib/licensed/sources/gradle.rb, line 21 def initialize(name:, version:, path:, url:, metadata: {}) @url = url super(name: name, version: version, path: path, metadata: metadata) end
Calls superclass method
Licensed::Dependency::new
Source
# File lib/licensed/sources/gradle.rb, line 17 def self.retrieve_license(url) (@licenses ||= {})[url] ||= Net::HTTP.get(URI(url)) end
Cache and return the results of getting the license content.
Public Instance Methods
Source
# File lib/licensed/sources/gradle.rb, line 27 def exist? # shouldn't force network connections just to check if content exists # only check that the path is not empty !path.to_s.empty? end
Returns whether the dependency content exists
Source
# File lib/licensed/sources/gradle.rb, line 34 def project_files return [] if @url.nil? license_data = self.class.retrieve_license(@url) Array(Licensee::ProjectFiles::LicenseFile.new(license_data, { uri: @url })) end
Returns a Licensee::ProjectFiles::LicenseFile for the dependency