public
Description: Rails plugin for integration of the Sunspot Solr library
Homepage: http://github.com/outoftime/sunspot_rails
Clone URL: git://github.com/outoftime/sunspot_rails.git
sunspot_rails / Rakefile
100644 28 lines (22 sloc) 0.777 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'rake'
require 'spec/rake/spectask'
require 'rake/rdoctask'
 
task :default => :spec
 
if File.exist?(sunspot_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'sunspot', 'lib')))
  STDERR.puts("Using sunspot lib at #{sunspot_lib}")
  $: << sunspot_lib
end
 
desc 'Run all specs'
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_files = FileList['spec/*_spec.rb']
  t.spec_opts << '--color'
end
 
task :environment do
  if ENV['SUNSPOT_LIB']
    $: << ENV['SUNSPOT_LIB']
  end
  ENV['RAILS_ROOT'] ||= File.join(File.dirname(__FILE__), 'spec', 'mock_app')
  ENV['RAILS_ENV'] ||= 'test'
  require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config', 'environment.rb'))
end
 
FileList['dev_tasks/*.rake', 'lib/sunspot/rails/tasks.rb'].each { |file| load(file) }