Sha256: 5b9642ee0e39e4e9884252fadfb7aa4cfda2683f13b678e99f42875a86038f18

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 Bytes

Contents

module Riddle
  class Configuration
    class Searchd
      NUMBER = 1.class

      def valid?
        set_listen

        !( @listen.nil? || @listen.empty? || @pid_file.nil? )
      end

      private

      def set_listen
        @listen = @listen.to_s if @listen.is_a?(NUMBER)

        return unless @listen.nil? || @listen.empty?

        @listen = []
        @listen << @port.to_s if @port
        @listen << "9306:mysql41" if @mysql41.is_a?(TrueClass)
        @listen << "#{@mysql41}:mysql41" if @mysql41.is_a?(NUMBER)

        @listen = @listen.collect { |line| "#{@address}:#{line}" } if @address
      end

      def settings
        @listen.nil? ? super : super - [:address, :port]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
riddle-2.2.0 lib/riddle/0.9.9/configuration/searchd.rb