2013-10-23 09:07:51 +02:00
|
|
|
require "html/proofer"
|
2015-03-07 18:47:24 +01:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
|
|
|
|
desc "Run specs"
|
|
|
|
RSpec::Core::RakeTask.new do |t|
|
|
|
|
t.pattern = 'spec/**/*_spec.rb'
|
|
|
|
t.rspec_opts = ["--order", "rand", "--color"]
|
|
|
|
end
|
2013-10-23 09:07:51 +02:00
|
|
|
|
|
|
|
task :test do
|
2013-10-23 09:23:57 +02:00
|
|
|
sh "bundle exec jekyll build --trace"
|
2015-03-07 18:49:49 +01:00
|
|
|
Rake::Task["spec"].invoke
|
2016-01-28 20:58:58 +01:00
|
|
|
HTML::Proofer.new("./_site", :check_html => true,
|
2016-02-03 18:24:05 +01:00
|
|
|
:validation => { :ignore_script_embeds => true },
|
2016-01-28 20:58:58 +01:00
|
|
|
:href_swap => { %r{http://choosealicense.com} => "" }).run
|
2013-10-23 09:07:51 +02:00
|
|
|
end
|
2016-01-16 00:01:07 +01:00
|
|
|
|
|
|
|
task :approved_licenses do
|
|
|
|
require './spec/spec_helper'
|
|
|
|
approved = approved_licenses
|
|
|
|
approved.select! { |l| spdx_ids.include?(l) }
|
|
|
|
puts "#{approved.count} approved licenses:"
|
|
|
|
puts approved.join(", ")
|
|
|
|
puts "\n"
|
2016-01-16 00:04:07 +01:00
|
|
|
|
2016-01-16 00:01:07 +01:00
|
|
|
potential = approved - licenses.map { |l| l["id"] }
|
|
|
|
puts "#{potential.count} potential additions:"
|
|
|
|
puts potential.join(", ")
|
|
|
|
end
|