diff --git a/.rubocop_fixme.yml b/.rubocop_fixme.yml index a35f7a1182..a51fe2641b 100644 --- a/.rubocop_fixme.yml +++ b/.rubocop_fixme.yml @@ -51,6 +51,10 @@ Style/PredicateName: Exclude: - 'app/helpers/hyrax/collections_helper.rb' +Style/SpecialGlobalVars: + Exclude: + - 'tasks/hyrax_dev.rake' + Rails/Output: Exclude: - 'lib/generators/**/*' diff --git a/tasks/hyrax_dev.rake b/tasks/hyrax_dev.rake index 7b8b0e61cc..f77ad37b8c 100644 --- a/tasks/hyrax_dev.rake +++ b/tasks/hyrax_dev.rake @@ -30,6 +30,27 @@ task :i18n_sorter do end end +if Gem.loaded_specs.key? :engine_cart + namespace :engine_cart do + # This generate task should only add its action to an existing engine_cart:generate task + raise 'engine_cart:generate task should already be defined' unless Rake::Task.task_defined?('engine_cart:generate') + task :generate do |_task| + puts 'Running post-generation operations...' + Rake::Task['engine_cart:after_generate'].invoke + end + + desc 'Operations that need to run after the test_app migrations have run' + task :after_generate do + puts 'Creating default collection type...' + EngineCart.within_test_app do + unless system "bundle exec rake hyrax:default_collection_types:create" + raise "EngineCart failed on with: #{$?}" + end + end + end + end +end + desc 'Generate the engine_cart and spin up test servers and run specs' task ci: ['rubocop', 'engine_cart:generate'] do puts 'running continuous integration'