<commit_before>class Bob

  def hey(drivel)
    if silent?(drivel)
      'Fine. Be that way.'
    elsif question?(drivel)
      'Sure.'
    elsif shouting?(drivel)
      'Woah, chill out!'
    else
      'Whatever.'
    end
  end

  private

  def question?(s)
    s.end_with?('?')
  end

  def silent?(s)
    s.nil? || s.empty?
  end

  def shouting?(s)
    s.upcase == s
  end

end

class Alice

  def hey(drivel)
    answerer(drivel).reply
  end

  private

  def answerer(drivel)
    handlers.find {|answer| answer.handles?(drivel)}.new
  end

  def handlers
    [AnswerSilence, AnswerQuestion, AnswerShout, AnswerDefault]
  end

end

class AnswerSilence

  def self.handles?(input)<commit_msg>Add another example to ruby:bob<commit_after>class Bob

  def hey(drivel)
    if silent?(drivel)
      'Fine. Be that way.'
    elsif question?(drivel)
      'Sure.'
    elsif shouting?(drivel)
      'Woah, chill out!'
    else
      'Whatever.'
    end
  end

  private

  def question?(s)
    s.end_with?('?')
  end

  def silent?(s)
    s.nil? || s.empty?
  end

  def shouting?(s)
    s.upcase == s
  end

end

class Alice

  def hey(drivel)
    respond_to Phrase.new(drivel.to_s)
  end

  def respond_to(phrase)
    if phrase.silent?
      'Fine. Be that way.'
    elsif phrase.question?
      'Sure.'
    elsif phrase.shouting?
      'Woah, chill out!'
    else
      'Whatever.'
    end
  end
end

class Phrase < String

  alias_method :silent?, :empty?

  def question?
    end_with?('?')
  end

  def shouting?
    upcase == self
  end

end

class Charlie

  def hey(drivel)
    answerer(drivel).reply
  end

  private

  def answerer(drivel)
    handlers.find {|answer| answer.handles?(drivel)}.new
  end

  def handlers
    [AnswerSilence, AnswerQuestion, AnswerShout, AnswerDefault]
  end

end

class AnswerSilence

  def self.handles?(input)
{'fraction_non_alphanumeric': 0.10961123110151189, 'fraction_numerical': 0.0, 'mean_word_length': 2.509469696969697, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6695351', 'n_tokens_mistral': 721, 'n_tokens_neox': 702, 'n_words': 173}