<commit_before>module Shoebill

  # It contains helper method used in framework
  class Utils

    # Changes CameCase string into underscore string.
    # Additionally, it changes '::' into '/', to find diretory to the file.
    def self.to_underscore(string)
      string.gsub('::', '/').
      gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
      gsub(/([a-z\d])([A-Z])/, '\1_\2').
      tr('-', '_').
      downcase
    end

    # Gets underscore name from CamelCase controller name.
    def self.get_controller_name(name)
      klass = name.to_s.match(/^(.+)Controller/).captures[0]
      to_underscore klass
    end

  end

end<commit_msg>add documentation to Utils class<commit_after>module Shoebill

  # It contains helper method used in framework
  class Utils

    # Changes CameCase string into underscore string.
    # Additionally, it changes '::' into '/', to return diretory to the file.
    # === Example
    #   Utils.to_underscore(Example::CamelCase) # returns example/camel_case
    def self.to_underscore(string)
      string.gsub('::', '/').
      gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
      gsub(/([a-z\d])([A-Z])/, '\1_\2').
      tr('-', '_').
      downcase
    end

    # Gets underscore name controller without 'Controller' word from CamelCase controller name.
    # It is used, for example, to get views folder.
    # === Example
    #   Utils.get_controller_name(MyCustomController) # returns my_custom
    def self.get_controller_name(name)
      klass = name.to_s.match(/^(.+)Controller/).captures[0]
      to_underscore klass
    end

  end

end
{'fraction_non_alphanumeric': 0.15232632249840664, 'fraction_numerical': 0.006373486297004461, 'mean_word_length': 2.801452784503632, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6472509', 'n_tokens_mistral': 536, 'n_tokens_neox': 526, 'n_words': 130}