Class: Spandx::Cli::Commands::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/cli/commands/build.rb

Constant Summary collapse

INDEXES =
{
  dotnet: Spandx::Dotnet::Index,
  maven: Spandx::Java::Index,
  nuget: Spandx::Dotnet::Index,
  pypi: Spandx::Python::Index,
  rubygems: Spandx::Ruby::Index,
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Build

Returns a new instance of Build.



15
16
17
# File 'lib/spandx/cli/commands/build.rb', line 15

def initialize(options)
  @options = options
end

Instance Method Details

#execute(output: $stdout) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/spandx/cli/commands/build.rb', line 19

def execute(output: $stdout)
  catalogue = Spandx::Spdx::Catalogue.from_git
  build_buckets
  indexes.each do |index|
    output.puts index.name
    index.update!(catalogue: catalogue, output: output)
  end
  output.puts 'OK'
end