<commit_before>module Promethee::Rails::Helper
  def promethee(data, options = {})
    ApplicationController.renderer.render partial: 'promethee/show', locals: { master_data: data, localization_data: options[:l] }
  end

  def promethee_class_for component
    "promethee__component promethee__component--#{component[:type]}"
  end

  # [
  #   Pathname:promethee/components/column/edit.define,
  #   Pathname:promethee/components/column/edit.inspect,
  #   Pathname:promethee/components/column/edit.move,
  #   Pathname:promethee/components/column/edit.write,
  #   Pathname:promethee/components/cover/edit.define,
  #   Pathname:promethee/components/cover/edit.inspect,
  #   ...
  # ]
  def promethee_component_partials
    promethee_component_partial_paths.map { |path| (path.dirname + path.basename('.html.erb').to_s[1..-1]).to_s }
  end

  protected

  # [
  #   Pathname:promethee/components/column/_edit.define.html.erb,
  #   Pathname:promethee/components/column/_edit.inspect.html.erb,
  #   Pathname:promethee/components/column/_edit.move.html.erb,
  #   Pathname:promethee/components/column/_edit.write.html.erb,
  #   Pathname:promethee/components/cover/_edit.define.html.erb,
  #   Pathname:promethee/components/cover/_edit.inspect.html.erb,
  #   ...
  # ]
  def promethee_component_partial_paths
    promethee_component_partial_sources.map do |source|
      Dir[source + 'promethee/components/*/_edit.*.html.erb'].map { |file| Pathname.new(file).relative_path_from source }
    end.flatten.uniq(&:to_s)
  end

  # [<commit_msg>Updated code comments<commit_after>module Promethee::Rails::Helper
  def promethee(data, options = {})
    ApplicationController.renderer.render partial: 'promethee/show', locals: { master_data: data, localization_data: options[:l] }
  end

  def promethee_class_for component
    "promethee__component promethee__component--#{component[:type]}"
  end

  # Example:
  # [
  #   'promethee/components/column/edit.define',
  #   'promethee/components/column/edit.inspect',
  #   'promethee/components/column/edit.move',
  #   'promethee/components/column/edit.write',
  #   'promethee/components/cover/edit.define',
  #   'promethee/components/cover/edit.inspect',
  #   ...
  # ]
  def promethee_component_partials
    promethee_component_partial_paths.map { |path| (path.dirname + path.basename('.html.erb').to_s[1..-1]).to_s }
  end

  protected

  # Example:
  # [
  #   Pathname:promethee/components/column/_edit.define.html.erb,
  #   Pathname:promethee/components/column/_edit.inspect.html.erb,
  #   Pathname:promethee/components/column/_edit.move.html.erb,
  #   Pathname:promethee/components/column/_edit.write.html.erb,
  #   Pathname:promethee/components/cover/_edit.define.html.erb,
  #   Pathname:promethee/components/cover/_edit.inspect.html.erb,
  #   ...
  # ]
  def promethee_component_partial_paths
    promethee_component_partial_sources.map do |source|
      Dir[source + 'promethee/components/*/_edit.*.html.erb'].map { |file| Pathname.new(file).relative_path_from source }
    end.flatten.uniq(&:to_s)
  end

  # Example:
  # [
{'fraction_non_alphanumeric': 0.13781947589776772, 'fraction_numerical': 0.0012940795858945326, 'mean_word_length': 4.110743801652893, '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': '3840914', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1096, 'n_words': 109}