<commit_before>module Serverspec
  module Type
    class DefaultGateway < Base
      def ipaddress
        ret = @runner.run_command(commands.check_routing_table('default'))
        ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
        $2 ? $2 : $4
      end

      def interface
        ret = @runner.run_command(commands.check_routing_table('default'))
        ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
        $3
      end

      def to_s
        'Default Gateway'
      end
    end
  end
end
<commit_msg>Fix default_gateway to pass the spec<commit_after>module Serverspec
  module Type
    class DefaultGateway < Base
      def ipaddress
        ret = @runner.run_command(commands.check_routing_table_has_entry('default'))
        ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
        $2 ? $2 : $4
      end

      def interface
        ret = @runner.run_command(commands.check_routing_table_has_entry('default'))
        ret.stdout =~ /^(\S+)(?: via (\S+))? dev (\S+).+(?:\r)?\n(?:default via (\S+))?/
        $3
      end

      def to_s
        'Default Gateway'
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.18889809444904723, 'fraction_numerical': 0.006628003314001657, 'mean_word_length': 2.264864864864865, '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': '4808588', 'n_tokens_mistral': 423, 'n_tokens_neox': 414, 'n_words': 95}