Module: Gitt::Sanitizers

Defined in:
lib/gitt/sanitizers/date.rb,
lib/gitt/sanitizers/email.rb,
lib/gitt/sanitizers/lines.rb,
lib/gitt/sanitizers/version.rb,
lib/gitt/sanitizers/scissors.rb,
lib/gitt/sanitizers/trailers.rb,
lib/gitt/sanitizers/container.rb,
lib/gitt/sanitizers/signature.rb,
lib/gitt/sanitizers/statistic.rb,
lib/gitt/sanitizers/paragraphs.rb

Defined Under Namespace

Classes: Paragraphs, Statistic, Trailers

Constant Summary collapse

Date =
-> text { text.sub(/\s.+\Z/, Core::EMPTY_STRING) if text }
Email =
-> text { text.tr "<>", Core::EMPTY_STRING if text }
Lines =
-> text { text ? text.split("\n") : Core::EMPTY_ARRAY }
Version =
-> text { text.delete_prefix "refs/tags/" if text }
Scissors =
-> text { text.sub(/^#\s-.+\s>8\s-.+/m, Core::EMPTY_STRING) if text }
CONTAINER =
{
  date: Date,
  email: Email,
  lines: Lines,
  paragraphs: Paragraphs.new,
  scissors: Scissors,
  signature: Signature,
  statistic: Statistic.new,
  trailers: Trailers.new,
  version: Version
}.freeze
Signature =
lambda do |text|
  case text
    when "B" then "Bad"
    when "E" then "Error"
    when "G" then "Good"
    when "N" then "None"
    when "R" then "Revoked"
    when "U" then "Unknown"
    when "X" then "Expired"
    when "Y" then "Expired Key"
    else "Invalid"
  end
end