Module: Satorix::CI::Test::Ruby::Brakeman

Extended by:
Brakeman
Includes:
Shared::Console
Included in:
Brakeman
Defined in:
lib/satorix/CI/test/ruby/brakeman.rb

Instance Method Summary collapse

Methods included from Shared::Console

#colorize, #colors, #humanize_time, #log, #log_bench, #log_command, #log_duration, #log_error, #log_error_and_abort, #log_header, #run_command, #source_env_from

Instance Method Details

#goObject



12
13
14
15
16
# File 'lib/satorix/CI/test/ruby/brakeman.rb', line 12

def go
  log_bench('Displaying current Ruby version...') { run_command(%w[ruby -v]) }
  log_bench('Installing Brakeman...') { install_gem }
  log_bench('Running Brakeman scan...') { run_scan }
end

#install_gemObject



19
20
21
# File 'lib/satorix/CI/test/ruby/brakeman.rb', line 19

def install_gem
  run_command(['gem', 'install', 'brakeman', '--no-document', '--bindir', Satorix.bin_dir])
end

#run_scanObject



24
25
26
# File 'lib/satorix/CI/test/ruby/brakeman.rb', line 24

def run_scan
  run_command(['brakeman', '-z', '--table-width', '1200', '--exit-on-error', '--path', Satorix.app_dir])
end