<commit_before># provide a backwards-compatible wrapper API and deprecate it

module Thrift
  unless const_defined?(:DEPRECATION)
    DEPRECATION = true
  end
end

class Module
  # Wraps the given methods to print a warning and call the real method
  # Example:
  #   deprecate! :readAll => :read_all
  #--
  # Yeah, this is ugly, passing a string to module_eval, but unfortunately
  # using a block removes the ability to pass blocks to the defined method
  # and breaks spec
  def deprecate!(methods)
    return unless Thrift::DEPRECATION
    methods.each_pair do |old, new|
      module_eval <<-EOF
        def #{old}(*args, &block)<commit_msg>Tweak the code to turn on Deprecation to make rcov happy<commit_after># provide a backwards-compatible wrapper API and deprecate it

module Thrift
  DEPRECATION = true unless const_defined?(:DEPRECATION)
end

class Module
  # Wraps the given methods to print a warning and call the real method
  # Example:
  #   deprecate! :readAll => :read_all
  #--
  # Yeah, this is ugly, passing a string to module_eval, but unfortunately
  # using a block removes the ability to pass blocks to the defined method
  # and breaks spec
  def deprecate!(methods)
    return unless Thrift::DEPRECATION
    methods.each_pair do |old, new|
      module_eval <<-EOF
        def #{old}(*args, &block)
{'fraction_non_alphanumeric': 0.07234363225320271, 'fraction_numerical': 0.0, 'mean_word_length': 3.676056338028169, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '6252876', 'n_tokens_mistral': 398, 'n_tokens_neox': 390, 'n_words': 162}