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

Version Path
utils-0.22.1 bin/brakeman2err
utils-0.22.0 bin/brakeman2err
utils-0.21.2 bin/brakeman2err
utils-0.21.1 bin/brakeman2err
utils-0.21.0 bin/brakeman2err
utils-0.20.0 bin/brakeman2err
utils-0.19.0 bin/brakeman2err
utils-0.18.1 bin/brakeman2err
utils-0.18.0 bin/brakeman2err
utils-0.17.0 bin/brakeman2err
utils-0.16.0 bin/brakeman2err
utils-0.15.1 bin/brakeman2err
utils-0.15.0 bin/brakeman2err
utils-0.14.0 bin/brakeman2err
utils-0.13.0 bin/brakeman2err
utils-0.12.0 bin/brakeman2err
utils-0.11.0 bin/brakeman2err
utils-0.10.1 bin/brakeman2err
utils-0.10.0 bin/brakeman2err