Class: LicenseFinder::NoticeFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/license_finder/package_utils/notice_files.rb

Constant Summary collapse

CANDIDATE_FILE_NAMES =
%w[NOTICE Notice].freeze
CANDIDATE_PATH_WILDCARD_STRICT =
"{#{CANDIDATE_FILE_NAMES.join(',')}}*"
CANDIDATE_PATH_WILDCARD =
"*#{CANDIDATE_PATH_WILDCARD_STRICT}"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(install_path) ⇒ NoticeFiles

Returns a new instance of NoticeFiles.



15
16
17
# File 'lib/license_finder/package_utils/notice_files.rb', line 15

def initialize(install_path)
  @install_path = install_path ? Pathname(install_path) : nil
end

Class Method Details

.find(install_path, options = {}) ⇒ Object



11
12
13
# File 'lib/license_finder/package_utils/notice_files.rb', line 11

def self.find(install_path, options = {})
  new(install_path).find(options)
end

Instance Method Details

#find(options = {}) ⇒ Object



19
20
21
22
# File 'lib/license_finder/package_utils/notice_files.rb', line 19

def find(options = {})
  paths_of_candidate_files
    .map { |path| PossibleLicenseFile.new(path, options) } # Not really possible license files, but that class has all we need.
end