Class: PolishGeeks::DevTools::Commands::BundlerAudit

Inherits:
Base
  • Object
show all
Defined in:
lib/polish_geeks/dev_tools/commands/bundler_audit.rb

Overview

Command wrapper for Bundler Audit Checks for vulnerable versions of gems in Gemfile.lock.

Constant Summary

Constants inherited from Base

PolishGeeks::DevTools::Commands::Base::TYPES

Instance Attribute Summary

Attributes inherited from Base

#output, #stored_output

Instance Method Summary collapse

Methods inherited from Base

#ensure_executable!, #error_message

Instance Method Details

#executeString

Executes this command

Returns:

  • (String)

    command output



12
13
14
# File 'lib/polish_geeks/dev_tools/commands/bundler_audit.rb', line 12

def execute
  @output = Shell.new.execute('bundle-audit update 2>&1 > /dev/null; bundle-audit check')
end

#valid?Boolean

Returns true if there were no vulnerabilities found.

Returns:

  • (Boolean)

    true if there were no vulnerabilities found



17
18
19
# File 'lib/polish_geeks/dev_tools/commands/bundler_audit.rb', line 17

def valid?
  @output.match(/Unpatched versions found/).nil?
end