File: Rakefile

package info (click to toggle)
ruby-acts-as-api 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 624 kB
  • sloc: ruby: 2,366; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 922 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'bundler'
require 'rspec/core'
require 'rspec/core/rake_task'

Bundler::GemHelper.install_tasks

RSpec::Core::RakeTask.new

namespace :spec do
  supported_orms = %w(mongoid active_record)

  supported_orms.each do |orm|
    desc "Run #{orm} specs only"
    RSpec::Core::RakeTask.new(orm) do |t|
      t.rspec_opts = ['--color']
    end

    task "prepare_#{orm}" do
      ENV['ACTS_AS_API_ORM'] = orm
    end

    Rake::Task["spec:#{orm}"].prerequisites << "spec:prepare_#{orm}"
  end

  desc "Runs specs for all ORMs (#{supported_orms.join(', ')})"
  task :all do
    supported_orms.each do |orm|
      puts "Starting to run specs for #{orm}..."
      system("bundle exec rake spec:#{orm}")
      raise "#{orm} failed!" unless $?.exitstatus.zero?
    end
  end

end

task default: 'spec:all'

desc 'Generate the gh_pages site'
task :rocco do
  system 'bundle exec rocco docs/index.rb -t docs/layout.mustache'
end