Sha256: 4932ba2d444c0d5b80446a82079db93a6f1db57aa46fd93275fc190812806dc5

Contents?: true

Size: 1.33 KB

Versions: 8

Compression:

Stored size: 1.33 KB

Contents

# frozen_string_literal: true

require 'engine_cart/rake_task'

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
  t.pattern = 'spec/**/*_spec.rb'
end

require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop)

desc "Run test suite"
task ci: ['blacklight:generate'] do
  within_test_app do
    system "RAILS_ENV=test rake blacklight:index:seed"
  end
  Rake::Task['blacklight:coverage'].invoke
end

namespace :blacklight do
  desc "Run tests with coverage"
  task :coverage do
    ENV['COVERAGE'] = 'true'
    Rake::Task["spec"].invoke
  end

  desc "Create the test rails app"
  task generate: ['engine_cart:generate'] do
  end

  namespace :internal do
    task seed: ['engine_cart:generate'] do
      within_test_app do
        system "bundle exec rake blacklight:index:seed"
      end
    end
  end

  desc 'Run Solr and Blacklight for interactive development'
  task :server, [:rails_server_args] do |_t, args|
    if File.exist? EngineCart.destination
      within_test_app do
        system "bundle update"
      end
    else
      Rake::Task['engine_cart:generate'].invoke
    end

    SolrWrapper.wrap do |solr|
      solr.with_collection do
        Rake::Task['blacklight:internal:seed'].invoke

        within_test_app do
          system "bundle exec rails s #{args[:rails_server_args]}"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight-7.7.0 tasks/blacklight.rake
blacklight-7.6.0 tasks/blacklight.rake
blacklight-7.5.1 tasks/blacklight.rake
blacklight-7.5.0 tasks/blacklight.rake
blacklight-7.4.2 tasks/blacklight.rake
blacklight-7.4.1 tasks/blacklight.rake
blacklight-7.4.0 tasks/blacklight.rake
blacklight-7.3.0 tasks/blacklight.rake