Sha256: 3e2114002467c77135e271974a9d618dc9bb8b7cc537dd601024cd6182665188

Contents?: true

Size: 742 Bytes

Versions: 11

Compression:

Stored size: 742 Bytes

Contents

module Riddle
  class Configuration
    class Searchd
      def valid?
        set_listen
        clear_deprecated

        !( @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 clear_deprecated
        return if @listen.nil?

        @address  = nil
        @port     = nil
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
riddle-1.5.10 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.9 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.8 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.7 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.6 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.5 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.4 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.3 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.2 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.1 lib/riddle/0.9.9/configuration/searchd.rb
riddle-1.5.0 lib/riddle/0.9.9/configuration/searchd.rb