Sha256: 1696d13ea4504a8a859eed0ddaa3e7eaa45f670bd809944850bdb1990bb2132d
Contents?: true
Size: 1019 Bytes
Versions: 19
Compression:
Stored size: 1019 Bytes
Contents
#!/usr/bin/env ruby require 'utils' require 'json' require 'tins/xt' require 'tins/go' include Tins::GO require 'infobar' opts = go 'ce' if opts[?c] brakeman = `bundle exec which brakeman`.full? or fail "cannot find brakeman in path" Infobar.busy(label: 'Computing brakeman results') do system 'bundle exec brakeman -q -i config/brakeman.yml -o .brakeman.json 2>/dev/null' or fail "calling brakeman failed" end else results = JSON File.read('.brakeman.json'), object_class: JSON::GenericObject if opts[?e] puts "Found #{results.errors.size} errors and #{results.warnings.size} warnings.", "_" * 80 for error in results.errors puts error.location, "Error #{error.error.inspect}" end else puts "Found #{results.warnings.size} warnings.", "_" * 80 end for warning in results.warnings puts "#{warning.file}:#{warning.line}", "#{warning.warning_type} (#{warning.confidence}) #{warning.message.inspect}", warning.code, "See: #{warning.link}" end end
Version data entries
19 entries across 19 versions & 1 rubygems