Class: Spandx::Cli::Commands::Scan

Inherits:
Object
  • Object
show all
Includes:
Spandx::Core
Defined in:
lib/spandx/cli/commands/scan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scan_path, options) ⇒ Scan

Returns a new instance of Scan.



10
11
12
13
14
# File 'lib/spandx/cli/commands/scan.rb', line 10

def initialize(scan_path, options)
  @scan_path = ::Pathname.new(scan_path)
  @options = options
  require(options[:require]) if options[:require]
end

Instance Attribute Details

#scan_pathObject (readonly)

Returns the value of attribute scan_path.



8
9
10
# File 'lib/spandx/cli/commands/scan.rb', line 8

def scan_path
  @scan_path
end

Instance Method Details

#execute(output: $stdout) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/spandx/cli/commands/scan.rb', line 16

def execute(output: $stdout)
  with_printer(output) do |printer|
    each_dependency do |dependency|
      printer.print_line(Plugin.enhance(dependency), output)
    end
  end
end