Sha256: aaa0faa90ae8f6980a9517f0d81c8882523152111cecd49792b13b77ef4047f5

Contents?: true

Size: 1.77 KB

Versions: 24

Compression:

Stored size: 1.77 KB

Contents

require 'rubygems'
require 'bundler'
require 'bundler/gem_tasks'

begin
  Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
  $stderr.puts e.message
  $stderr.puts "Run `bundle install` to install missing gems"
  exit e.status_code
end

# Get your spec rake tasks working in RSpec 2.0

require 'rspec/core/rake_task'

desc 'Default: run specs.'
task :default => :spec

desc "Run specs"
RSpec::Core::RakeTask.new do |t|

  if ENV['COVERAGE'] and RUBY_VERSION =~ /^1.8/
    t.rcov = true
    t.rcov_opts = %w{--exclude spec\/*,gems\/*,ruby\/* --aggregate coverage.data}
  end
end

require 'yard'
YARD::Rake::YardocTask.new do |t|
  t.options = ["--readme", "README.rdoc"]
end

desc "Open an irb session preloaded with this library"
task :console do
  sh "irb -rubygems -I lib -r rubydora.rb"
end

desc "Execute Continuous Integration build"
task :ci do
  unless ENV['environment'] == 'test'
    exec("rake ci environment=test") 
  end

  require 'jettywrapper'
  jetty_params = {
    :jetty_home => File.expand_path(File.dirname(__FILE__) + '/jetty'),
    :quiet => false,
    :jetty_port => ENV['TEST_JETTY_PORT'] || 8983,
    :solr_home => File.expand_path(File.dirname(__FILE__) + '/jetty/solr'),
    :fedora_home => File.expand_path(File.dirname(__FILE__) + '/jetty/fedora/default'),
    :startup_wait => 30,
    :java_opts => ['-Xmx256m', '-XX:MaxPermSize=128m']
  }

  error = Jettywrapper.wrap(jetty_params) do
    Rake::Task['coverage'].invoke
    Rake::Task['yard'].invoke
  end
  raise "test failures: #{error}" if error
end


desc "Execute specs with coverage"
task :coverage do 
  # Put spec opts in a file named .rspec in root
  ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
  ENV['COVERAGE'] = 'true' unless ruby_engine == 'jruby'


  Rake::Task['spec'].invoke
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rubydora-0.5.12 Rakefile
rubydora-0.5.11 Rakefile
rubydora-0.5.10 Rakefile
rubydora-0.5.9 Rakefile