Class: LicenseFinder::PossibleLicenseFiles

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

Constant Summary collapse

CANDIDATE_FILE_NAMES =
%w(LICENSE License Licence COPYING README Readme ReadMe)
CANDIDATE_PATH_WILDCARD =
"*{#{CANDIDATE_FILE_NAMES.join(',')}}*"

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(install_path) ⇒ PossibleLicenseFiles

Returns a new instance of PossibleLicenseFiles.



10
11
12
# File 'lib/license_finder/possible_license_files.rb', line 10

def initialize(install_path)
  @install_path = Pathname(install_path)
end

Class Method Details

.find(install_path) ⇒ Object



6
7
8
# File 'lib/license_finder/possible_license_files.rb', line 6

def self.find(install_path)
  new(install_path).find
end

Instance Method Details

#findObject



14
15
16
17
18
# File 'lib/license_finder/possible_license_files.rb', line 14

def find
  paths_of_candidate_files.map do |path|
    file_at_path(path)
  end
end