Sha256: f385087d358c223a0209a6eb61d40a205f31d6a281c7b3514d01739d199c7616

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

require 'riddle/configuration/section'
require 'riddle/configuration/index_settings'

require 'riddle/configuration/distributed_index'
require 'riddle/configuration/index'
require 'riddle/configuration/indexer'
require 'riddle/configuration/realtime_index'
require 'riddle/configuration/remote_index'
require 'riddle/configuration/searchd'
require 'riddle/configuration/source'
require 'riddle/configuration/sql_source'
require 'riddle/configuration/xml_source'

require 'riddle/configuration/parser'

module Riddle
  class Configuration
    class ConfigurationError < StandardError #:nodoc:
    end

    attr_reader :indices, :searchd, :sources
    attr_accessor :indexer

    def self.parse!(input)
      Riddle::Configuration::Parser.new(input).parse!
    end

    def initialize
      @indexer = Riddle::Configuration::Indexer.new
      @searchd = Riddle::Configuration::Searchd.new
      @indices = []
      @sources = []
    end

    def render
      (
        [@indexer.render, @searchd.render] +
        @sources.collect { |source| source.render } +
        @indices.collect { |index| index.render }
      ).join("\n")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
riddle-1.5.9 lib/riddle/configuration.rb
riddle-1.5.8 lib/riddle/configuration.rb
riddle-1.5.7 lib/riddle/configuration.rb
riddle-1.5.6 lib/riddle/configuration.rb
riddle-1.5.5 lib/riddle/configuration.rb
riddle-1.5.4 lib/riddle/configuration.rb