lib/licensed/commands/status.rb
# Verifies that a cached record exists, is up to date and
# has license data that complies with the licensed configuration.
#
# app - The application configuration for the dependency
# source - The dependency source enumerator for the dependency
# dependency - An application dependency
# report - A report hash for the command to provide extra data for the report output.
#
# Returns whether the dependency has a cached record that is compliant
# with the licensed configuration.
Verifies that a cached record exists, is up to date and
has license data that complies with the licensed configuration.

The application configuration for the dependency
source - The dependency source enumerator for the dependency
dependency - An application dependency
report - A report hash for the command to provide extra data for the report output.

Returns whether the dependency has a cached record that is compliant
with the licensed configuration.
Verifies that a cached record exists is up to date and has license data that complies with the licensed configuration . The application configuration for the dependency source - The dependency source enumerator for the dependency dependency - An application dependency report - A report hash for the command to provide extra data for the report output . Returns whether the dependency has a cached record that is compliant with the licensed configuration .
def evaluate_dependency(app, source, dependency, report)
        filename = app.cache_path.join(source.class.type, "#{dependency.name}.#{DependencyRecord::EXTENSION}")
        report["filename"] = filename
        cached_record = cached_record(filename)
        if cached_record.nil?
          report.errors << "cached dependency record not found"
        else
          report.errors << "cached dependency record out of date" if cached_record["version"] != dependency.version
          report.errors << "missing license text" if cached_record.licenses.empty?
          if cached_record["review_changed_license"]
            report.errors << "license text has changed and needs re-review. if the new text is ok, remove the `review_changed_license` flag from the cached record"
          elsif license_needs_review?(app, cached_record)
            report.errors << "license needs review: #{cached_record["license"]}"
          end
        end
        report.errors.empty?
      end
def evaluate_dependency ( app , source , dependency , report ) filename = app . cache_path . join ( source . class . type , "#{dependency.name}.#{DependencyRecord::EXTENSION}" ) report [ "filename" ] = filename cached_record = cached_record ( filename ) if cached_record . nil? report . errors << "cached dependency record not found" else report . errors << "cached dependency record out of date" if cached_record [ "version" ] != dependency . version report . errors << "missing license text" if cached_record . licenses . empty? if cached_record [ "review_changed_license" ] report . errors << "license text has changed and needs re-review. if the new text is ok, remove the `review_changed_license` flag from the cached record" elsif license_needs_review? ( app , cached_record ) report . errors << "license needs review: #{cached_record["license"]}" end end report . errors . empty? end
Verifies that a cached record exists, is up to date and
has license data that complies with the licensed configuration.
Verifies that a cached record exists is up to date and has license data that complies with the licensed configuration .
app
<not_specific>
source
<not_specific>
dependency
<not_specific>
report
<not_specific>