Sha256: 8d024c83c16adb01a6a557e65e46419922f91ba987515ee1068cadf4eed2cda3

Contents?: true

Size: 608 Bytes

Versions: 9

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

module Spandx
  module Commands
    class Scan < Spandx::Command
      attr_reader :lockfile

      def initialize(lockfile, options)
        @lockfile = lockfile ? ::Pathname.new(File.expand_path(lockfile)) : nil
        @options = options
      end

      def execute(output: $stdout)
        if lockfile.nil?
          output.puts 'OK'
        else
          report = Report.new
          Parsers.for(lockfile).parse(lockfile).each do |dependency|
            report.add(dependency)
          end
          output.puts report.to_json
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spandx-0.5.0 lib/spandx/commands/scan.rb
spandx-0.4.1 lib/spandx/commands/scan.rb
spandx-0.4.0 lib/spandx/commands/scan.rb
spandx-0.3.0 lib/spandx/commands/scan.rb
spandx-0.2.0 lib/spandx/commands/scan.rb
spandx-0.1.7 lib/spandx/commands/scan.rb
spandx-0.1.6 lib/spandx/commands/scan.rb
spandx-0.1.5 lib/spandx/commands/scan.rb
spandx-0.1.4 lib/spandx/commands/scan.rb