Sha256: 787a0a2fe7f33cf940833bdafc52398471d9f27f2b1f18168226d51626f5d269

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

module Riddle
  class Configuration
    class Searchd
      def valid?
        set_listen

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

      private

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

        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?(Fixnum)

        @listen.each { |l| l.insert(0, "#{@address}:") } if @address
      end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
riddle-2.0.0 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.12 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.11 lib/riddle/0.9.9/configuration/searchd.rb