<commit_before>require 'socket'

module Guard
  class Yard
    class Server
      attr_accessor :options, :pid, :port

      def initialize(options, port)
        @options = options || ''
        @port = port || '8808'
      end

      def spawn
        self.pid = fork
        raise 'Fork failed' if pid == -1

        unless pid
          Signal.trap('QUIT', 'IGNORE')
          Signal.trap('INT', 'IGNORE')
          Signal.trap('TSTP', 'IGNORE')

          exec("yard server #{options} -c -p #{port}")
        end
        pid
      end

      def kill
        Process.kill('KILL', pid) unless pid.nil?
        true
      end
<commit_msg>Bugfix: don't start server with -c.<commit_after>require 'socket'

module Guard
  class Yard
    class Server
      attr_accessor :options, :pid, :port

      def initialize(options, port)
        @options = options || ''
        @port = port || '8808'
      end

      def spawn
        self.pid = fork
        raise 'Fork failed' if pid == -1

        unless pid
          Signal.trap('QUIT', 'IGNORE')
          Signal.trap('INT', 'IGNORE')
          Signal.trap('TSTP', 'IGNORE')

          exec("yard server #{options} -p #{port}")
        end
        pid
      end

      def kill
        Process.kill('KILL', pid) unless pid.nil?
        true
      end

{'fraction_non_alphanumeric': 0.1191391237509608, 'fraction_numerical': 0.007686395080707148, 'mean_word_length': 1.7012448132780082, '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': '1647785', 'n_tokens_mistral': 420, 'n_tokens_neox': 391, 'n_words': 116}