class Licensed::Sources::Bundler::Dependency
Attributes
Public Class Methods
Source
# File lib/licensed/sources/bundler.rb, line 16 def initialize(name:, version:, path:, loaded_from:, errors: [], metadata: {}) @loaded_from = loaded_from super name: name, version: version, path: path, errors: errors, metadata: metadata end
Calls superclass method
Licensed::Dependency::new
Public Instance Methods
Source
# File lib/licensed/sources/bundler.rb, line 23 def package_file super || spec_file end
Load a package manager file from the base Licensee::Projects::FsProject or from a gem specification file.
Calls superclass method
Private Instance Methods
Source
# File lib/licensed/sources/bundler.rb, line 31 def spec_file return @spec_file if defined?(@spec_file) return @spec_file = nil unless loaded_from && File.file?(loaded_from) @spec_file = begin file = { name: File.basename(loaded_from), dir: File.dirname(loaded_from) } Licensee::ProjectFiles::PackageManagerFile.new(File.read(loaded_from), file) end end
Find a package manager file from the given bundler specification’s ‘loaded_from` if available.