Sha256: f26c7c6efae48f1d6338ed9e66d11744a24f358f0d44ff2674d2e19cfc406293

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

namespace :thebes do

  desc "Build the sphinx config files"
  task :build do
    unless File.exists?(File.join(Rails.root, 'config', 'sphinx.yml'))
      raise 'No config file present, please create a config/sphinx.yml'
    end
    config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'sphinx.yml'))).result)[Rails.env.to_s]
    generator = Thebes::ConfigWriter.new(File.join(Rails.root, 'config'))
    config.each do |file, conf|
      if file[0].chr != '/'
        file = File.join(Rails.root, 'config', file)
      end
      generator.build file, (conf || {})
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thebes-0.0.3 railties/thebes.rake