Sha256: e24cdbc789c7fca70a707bfd1938e136dda564627fae2190fc7a36e55cf048ab

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

ENV['RAILS_ENV']  = (ENV['RAILS_ENV'] || 'development').dup
# RAILS_ROOT isn't defined yet, so figure it out.
require "uri"
dir = File.dirname(__FILE__)
SOLR_PATH = File.expand_path("#{dir}/../solr") unless defined? SOLR_PATH

SOLR_LOGS_PATH = "#{RAILS_ROOT}/log" unless defined? SOLR_LOGS_PATH
SOLR_PIDS_PATH = "#{RAILS_ROOT}/tmp/pids" unless defined? SOLR_PIDS_PATH
SOLR_DATA_PATH = "#{RAILS_ROOT}/solr/#{ENV['RAILS_ENV']}" unless defined? SOLR_DATA_PATH

unless defined? SOLR_PORT
  config = YAML::load_file(RAILS_ROOT+'/config/solr.yml')
  
  SOLR_PORT = ENV['PORT'] || URI.parse(config[ENV['RAILS_ENV']]['url']).port
end

SOLR_JVM_OPTIONS = config[ENV['RAILS_ENV']]['jvm_options'] unless defined? SOLR_JVM_OPTIONS

if ENV['RAILS_ENV'] == 'test'
  DB = (ENV['DB'] ? ENV['DB'] : 'mysql') unless defined?(DB)
  MYSQL_USER = (ENV['MYSQL_USER'].nil? ? 'root' : ENV['MYSQL_USER']) unless defined? MYSQL_USER
  require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'test', 'db', 'connections', DB, 'connection.rb')
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
honkster-acts_as_solr-0.2.1 config/solr_environment.rb