Module: LicenseScout::Config
- Extended by:
- Mixlib::Config
- Defined in:
- lib/license_scout/config.rb
Class Method Summary collapse
Class Method Details
.all_directories ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/license_scout/config.rb', line 86 def all_directories if include_subdirectories new_directories = [] directories.each do |old_directory| new_directories << old_directory Dir.chdir(old_directory) do new_directories << Dir.glob("**/*").select { |f| File.directory?(f) }.map { |d| File.join(old_directory, d) } end end new_directories.flatten.compact else directories end end |
.validate! ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/license_scout/config.rb', line 103 def validate! if !allowed_licenses.empty? && !flagged_licenses.empty? raise LicenseScout::Exceptions::ConfigError.new("You may specify a list of licenses to allow or flag. You may not specify both.") end if (allowed_licenses.empty? && flagged_licenses.empty?) && dependency_exceptions? LicenseScout::Log.warn("You have specified one or more dependency exceptions, but no allowed or flagged licenses. License Scout will ignore the depdendency exceptions.") end directories.each do |dir| unless File.directory?(File.(dir)) raise LicenseScout::Exceptions::ConfigError.new("The '#{dir}' directory could not be found.") end end end |