Sha256: ad955aae97fbf73b3f678b0c6817b706ce8283d544b4668065498281d683b3c8

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

require "bundler/gem_tasks"
require "finstyle"
require "rubocop/rake_task"
require "rspec/core/rake_task"

task default: :test

desc "Run specs"
RSpec::Core::RakeTask.new(:spec) do |spec|
  spec.pattern = "spec/**/*_spec.rb"
end

desc "Run rubocop"
RuboCop::RakeTask.new do |task|
  task.options << "--display-cop-names"
end

desc "Run all tests"
task test: [:rubocop, :spec, :unstable]

desc "Run unstable channel tests"
task "unstable" do
  if ENV["ARTIFACTORY_USERNAME"].nil? || ENV["ARTIFACTORY_PASSWORD"].nil?
    abort <<-EOS.gsub(/^\s+/, "")
      Must set ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD environment
      variables to run unstable tests
    EOS
  end
  Rake::Task["rubocop"].invoke
  system("bundle exec rspec -t unstable")
end

desc "Run tests for Travis CI"
task ci: [:rubocop, :spec]

desc "Render product matrix documentation"
task "matrix" do
  require "mixlib/install/product"

  doc_file = File.join(File.dirname(__FILE__), "PRODUCT_MATRIX.md")
  puts "Updating doc file at: #{doc_file}"

  File.open(doc_file, "w+") do |f|
    f.puts("| Product | Product Key  |")
    f.puts("| ------- | ------------ |")
    PRODUCT_MATRIX.products.sort.each do |p_key|
      product = PRODUCT_MATRIX.lookup(p_key)
      f.puts("| #{product.product_name} | #{p_key} |")
    end
    f.puts("")
    f.puts("Do not modify this file manually. It is automatically rendered via a rake task.")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wjordan-mixlib-install-0.8.0.fork.7 Rakefile
wjordan-mixlib-install-0.8.0.alpha.6 Rakefile