<commit_before>require 'tapp/version'
require 'pp'

class Object
  def tapp
    tap { pp block_given? ? yield(self) : self }
  end

  def taputs
    tap { puts block_given? ? yield(self) : self }
  end

  def taap
    require 'ap'
    tap { ap block_given? ? yield(self) : self }
  rescue LoadError
    warn "Sorry, you need to install awesome_print: `gem install awesome_print`"
  end
end<commit_msg>support verbose option or something, see #4<commit_after>require 'tapp/version'
require 'pp'

module Tapp
  class << self
    attr_accessor :verbose

    def report_called
      return unless verbose
      method_quoted = caller[0].split(':in').last.strip
      puts "#{method_quoted} in #{caller[1]}"
    end
  end
end

class Object
  def tapp
    Tapp.report_called
    tap { pp block_given? ? yield(self) : self }
  end

  def taputs
    Tapp.report_called
    tap { puts block_given? ? yield(self) : self }
  end

  def taap
    Tapp.report_called
    require 'ap'
    tap { ap block_given? ? yield(self) : self }
  rescue LoadError
    warn "Sorry, you need to install awesome_print: `gem install awesome_print`"
  end
end

{'fraction_non_alphanumeric': 0.0912311780336581, 'fraction_numerical': 0.002657218777679362, 'mean_word_length': 3.109090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3979534', 'n_tokens_mistral': 389, 'n_tokens_neox': 378, 'n_words': 118}