module Brakeman::Messages

Public Instance Methods

msg(*args) click to toggle source

Create a new message from a list of messages. Strings are converted to Brakeman::Messages::Plain objects.

# File lib/brakeman/messages.rb, line 5
def msg *args
  parts = args.map do |a|
    if a.is_a? String
      Plain.new(a)
    else
      a
    end
  end

  Message.new(*parts)
end
msg_code(code) click to toggle source

Create a new code message fragment

# File lib/brakeman/messages.rb, line 18
def msg_code code
  Code.new code
end
msg_cve(cve) click to toggle source

Create a new message fragment with a CVE identifier

# File lib/brakeman/messages.rb, line 23
def msg_cve cve
  CVE.new cve
end
msg_file(str) click to toggle source

Create a new message fragment representing a file name

# File lib/brakeman/messages.rb, line 28
def msg_file str
  Messages::FileName.new str
end
msg_input(input) click to toggle source

Create a new message fragment from a user input type (e.g. `:params`). The input type will be converted to a friendly version (e.g. “parameter value”).

# File lib/brakeman/messages.rb, line 34
def msg_input input
  Input.new input
end
msg_lit(str) click to toggle source

Create a new message fragment which will not be modified during output

# File lib/brakeman/messages.rb, line 39
def msg_lit str
  Literal.new str
end
msg_plain(str) click to toggle source

Create a new plain string message fragment

# File lib/brakeman/messages.rb, line 44
def msg_plain str
  Plain.new str
end
msg_version(version, lib = "Rails") click to toggle source

Create a message fragment representing the version of a library

# File lib/brakeman/messages.rb, line 49
def msg_version version, lib = "Rails"
  Version.new version, lib
end