<commit_before>#!/usr/bin/ruby -w
# -*- ruby -*-

require 'svnx/base/action'

module Svnx
  module Log
  end
end

module Svnx::Log
  class EntryPath
    include Comparable
    
    attr_reader :kind, :action, :name, :prop_mods, :text_mods
    
    def initialize attr: nil, kind: nil, action: nil, name: nil, prop_mods: nil, text_mods: nil
      if attr
        @kind = attribute_value attr, 'kind'
        act = attribute_value attr, 'action'
        @action = Svnx::Action.new act
        @name = attr.text
        @prop_mods = "true" == attribute_value(attr, 'prop-mods')
        @text_mods = "true" == attribute_value(attr, 'text-mods')
      else
        @kind = kind
        @action = action
        @name = name
        @prop_mods = prop_mods
        @text_mods = text_mods
      end
    end

    def to_s
      @name
    end

    def <=> other
      name <=> other.name
    end

    def match? action, filter
      @action.to_s == action.to_s && @name.start_with?(filter)
    end

    def attribute_value xmlelement, attrname, meth = nil
      value = xmlelement[attrname.to_s]
      meth ? value.send(meth) : value
    end    
  end<commit_msg>Replace inspect with to_s for entry path<commit_after>#!/usr/bin/ruby -w
# -*- ruby -*-

require 'svnx/base/action'

module Svnx
  module Log
  end
end

module Svnx::Log
  class EntryPath
    include Comparable
    
    attr_reader :kind, :action, :name, :prop_mods, :text_mods
    
    def initialize attr: nil, kind: nil, action: nil, name: nil, prop_mods: nil, text_mods: nil
      if attr
        @kind = attribute_value attr, 'kind'
        act = attribute_value attr, 'action'
        @action = Svnx::Action.new act
        @name = attr.text
        @prop_mods = "true" == attribute_value(attr, 'prop-mods')
        @text_mods = "true" == attribute_value(attr, 'text-mods')
      else
        @kind = kind
        @action = action
        @name = name
        @prop_mods = prop_mods
        @text_mods = text_mods
      end
    end

    def to_s
      @name
    end

    def inspect
      to_s
    end

    def <=> other
      name <=> other.name
    end

    def match? action, filter
      @action.to_s == action.to_s && @name.start_with?(filter)
    end

    def attribute_value xmlelement, attrname, meth = nil
      value = xmlelement[attrname.to_s]
      meth ? value.send(meth) : value
    end    
  end
{'fraction_non_alphanumeric': 0.10721823554242296, 'fraction_numerical': 0.0, 'mean_word_length': 2.185483870967742, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5970191', 'n_tokens_mistral': 820, 'n_tokens_neox': 810, 'n_words': 215}