Class: Spandx::Cli::Main

Inherits:
Thor
  • Object
show all
Defined in:
lib/spandx/cli/main.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



37
38
39
40
41
42
43
44
# File 'lib/spandx/cli/main.rb', line 37

def build(*)
  if options[:help]
    invoke :help, ['build']
  else
    Spandx.logger = Logger.new(options[:logfile])
    Commands::Build.new(options).execute
  end
end

#pullObject



24
25
26
27
28
29
30
# File 'lib/spandx/cli/main.rb', line 24

def pull(*)
  if options[:help]
    invoke :help, ['pull']
  else
    Commands::Pull.new(options).execute
  end
end

#scan(lockfile = Pathname.pwd) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/spandx/cli/main.rb', line 14

def scan(lockfile = Pathname.pwd)
  return invoke :help, ['scan'] if options[:help]

  prepare(options)
  pull if options[:pull]
  Spandx::Cli::Commands::Scan.new(lockfile, options).execute
end

#versionObject



47
48
49
# File 'lib/spandx/cli/main.rb', line 47

def version
  puts "v#{Spandx::VERSION}"
end