Sha256: c49e6e617bd42e50ad7e19623146640df782c114a289d2e3027505647ea65a90

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

require 'rake/testtask'

# Tasks
namespace :foreman_resource_quota do
  namespace :example do
    desc 'Example Task'
    task task: :environment do
      # Task goes here
    end
  end
end

# Tests
namespace :test do
  desc 'Test ForemanResourceQuota'
  Rake::TestTask.new(:foreman_resource_quota) do |t|
    test_dir = File.expand_path('../../test', __dir__)
    t.libs << 'test'
    t.libs << test_dir
    t.pattern = "#{test_dir}/**/*_test.rb"
    t.verbose = true
    t.warning = false
  end
end

namespace :foreman_resource_quota do
  task rubocop: :environment do
    begin
      require 'rubocop/rake_task'
      RuboCop::RakeTask.new(:rubocop_foreman_resource_quota) do |task|
        task.patterns = ["#{ForemanResourceQuota::Engine.root}/app/**/*.rb",
                         "#{ForemanResourceQuota::Engine.root}/lib/**/*.rb",
                         "#{ForemanResourceQuota::Engine.root}/test/**/*.rb"]
      end
    rescue StandardError
      puts 'Rubocop not loaded.'
    end

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

Rake::Task[:test].enhance ['test:foreman_resource_quota']

load 'tasks/jenkins.rake'
if Rake::Task.task_defined?(:'jenkins:unit')
  Rake::Task['jenkins:unit'].enhance ['test:foreman_resource_quota', 'foreman_resource_quota:rubocop']
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_resource_quota-0.3.1 lib/tasks/foreman_resource_quota_tasks.rake
foreman_resource_quota-0.3.0 lib/tasks/foreman_resource_quota_tasks.rake
foreman_resource_quota-0.2.0 lib/tasks/foreman_resource_quota_tasks.rake
foreman_resource_quota-0.1.0 lib/tasks/foreman_resource_quota_tasks.rake