<commit_before>#
# This worker can use information to build a Component::Nic
# object from a report.
#
class ReportWorker::Parser::Component::Nic < ReportWorker::Parser
  TYPES = %w(computer)

  REQUIRE = [:lshw]

  def initialize(report)
    @report = report
    @nics = {}
  end

  def analyze
    # extract the necessary information to identify the computer
    parse_lshw

    @nics.each do |nic_connector,information|
      # Try to find an existing NIC with on of the IP addresses, if it does not exist create a new one
      nic = ::Component::Nic.find_by_mac_address(information[:mac_addresses].first) || ::Component::Nic.new

      puts "Found NIC #{information[:name]} with MACs #{information[:mac].to_sentence}"<commit_msg>remove debug output<commit_after>#
# This worker can use information to build a Component::Nic
# object from a report.
#
class ReportWorker::Parser::Component::Nic < ReportWorker::Parser
  TYPES = %w(computer)

  REQUIRE = [:lshw]

  def initialize(report)
    @report = report
    @nics = {}
  end

  def analyze
    # extract the necessary information to identify the computer
    parse_lshw

    @nics.each do |nic_connector,information|
      # Try to find an existing NIC with on of the IP addresses, if it does not exist create a new one
      nic = ::Component::Nic.find_by_mac_address(information[:mac_addresses].first) || ::Component::Nic.new
{'fraction_non_alphanumeric': 0.1003610108303249, 'fraction_numerical': 0.0, 'mean_word_length': 4.0583941605839415, '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': '5210274', 'n_tokens_mistral': 423, 'n_tokens_neox': 403, 'n_words': 138}