Sha256: cea84086e8d7b42374551218c01966755b971ccb5bd4250d531b02a043cb622e

Contents?: true

Size: 1.17 KB

Versions: 20

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true
module Licensed
  module Commands
    class Notices < Command
      # Returns the default reporter to use during the command run
      #
      # options - The options the command was run with
      #
      # Returns a Licensed::Reporters::CacheReporter
      def default_reporter(options)
        Licensed::Reporters::NoticesReporter.new
      end

      protected

      # Load stored dependency record data to add to the notices report.
      #
      # 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 true.
      def evaluate_dependency(app, source, dependency, report)
        filename = app.cache_path.join(source.class.type, "#{dependency.name}.#{DependencyRecord::EXTENSION}")
        report["cached_record"] = Licensed::DependencyRecord.read(filename)
        if !report["cached_record"]
          report.warnings << "expected cached record not found at #{filename}"
        end

        true
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
licensed-3.8.0 lib/licensed/commands/notices.rb
licensed-3.7.5 lib/licensed/commands/notices.rb
licensed-3.7.4 lib/licensed/commands/notices.rb
licensed-3.7.3 lib/licensed/commands/notices.rb
licensed-3.7.2 lib/licensed/commands/notices.rb
licensed-3.7.1 lib/licensed/commands/notices.rb
licensed-3.7.0 lib/licensed/commands/notices.rb
licensed-3.6.0 lib/licensed/commands/notices.rb
licensed-3.5.0 lib/licensed/commands/notices.rb
licensed-3.4.4 lib/licensed/commands/notices.rb
licensed-3.4.3 lib/licensed/commands/notices.rb
licensed-3.4.2 lib/licensed/commands/notices.rb
licensed-3.4.1 lib/licensed/commands/notices.rb
licensed-3.4.0 lib/licensed/commands/notices.rb
licensed-3.3.1 lib/licensed/commands/notices.rb
licensed-3.3.0 lib/licensed/commands/notices.rb
licensed-3.2.3 lib/licensed/commands/notices.rb
licensed-3.2.2 lib/licensed/commands/notices.rb
licensed-3.2.1 lib/licensed/commands/notices.rb
licensed-3.2.0 lib/licensed/commands/notices.rb