<commit_before>%w{
  punchblock
  rspec-rayo
  active_support/core_ext/module/delegation
  singleton
}.each { |f| require f }

module CucumberVoIP
  class RayoDriver
    include Singleton

    attr_reader :options

    delegate :cleanup_calls, :dial, :to => :@rayo

    class << self
      def method_missing(method_name, *args, &block)
        if instance.respond_to? method_name
          instance.send method_name, *args, &block
        else
          super
        end
      end

      def respond_to?(method_name)
        return true if instance.respond_to? method_name
        super
      end
    end

    def initialize
      @options = {
                    :jid            => 'userb@127.0.0.1',
                    :password       => '1',
                    :host           => '127.0.0.1',
                    :queue_timeout  => 30,
                    :write_timeout  => 30,
                    :log_file       => 'log/cucumber_voip.log'
                  }
    end

    def options=(other)
      options.merge! other
    end

    def start
      raise StandardError, 'You cannot start the Rayo driver more than once!' if @rayo
      @rayo = RSpecRayo::RayoDriver.new :username         => options[:jid],
                                        :password         => options[:password],
                                        :host             => options[:host],<commit_msg>Allow the creation of more than one RayoDriver instance<commit_after>%w{
  punchblock
  rspec-rayo
  active_support/core_ext/module/delegation
}.each { |f| require f }

module CucumberVoIP
  class RayoDriver
    @@tester_instance = nil
    @@target_instance = nil

    attr_reader :options

    delegate :cleanup_calls, :dial, :to => :@rayo

    class << self
      def tester_instance
        @@tester_instance ||= new
      end

      def target_instance
        @@target_instance ||= new
      end

      def method_missing(method_name, *args, &block)
        if tester_instance.respond_to? method_name
          tester_instance.send method_name, *args, &block
        else
          super
        end
      end

      def respond_to?(method_name)
        return true if tester_instance.respond_to? method_name
        super
      end
    end

    def initialize
      @options = {
                    :jid            => 'userb@127.0.0.1',
                    :password       => '1',
                    :host           => '127.0.0.1',
                    :queue_timeout  => 30,
                    :write_timeout  => 30,
                    :log_file       => 'log/cucumber_voip.log'
                  }
    end

    def options=(other)
      options.merge! other
    end

    def start
      raise StandardError, 'You cannot start the Rayo driver more than once!' if @rayo
      @rayo = RSpecRayo::RayoDriver.new :username         => options[:jid],
                                        :password         => options[:password],
                                        :host             => options[:host],
{'fraction_non_alphanumeric': 0.08881469115191987, 'fraction_numerical': 0.011352253756260434, 'mean_word_length': 1.4638157894736843, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '950076', 'n_tokens_mistral': 862, 'n_tokens_neox': 816, 'n_words': 206}