2017-01-18 13:31:19 -08:00
|
|
|
# frozen_string_literal: true
|
2017-03-26 17:19:44 -07:00
|
|
|
|
2016-03-17 17:30:47 -07:00
|
|
|
require 'html-proofer'
|
2015-03-07 12:47:24 -05:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
|
2016-02-08 15:37:19 -05:00
|
|
|
desc 'Run specs'
|
2015-03-07 12:47:24 -05:00
|
|
|
RSpec::Core::RakeTask.new do |t|
|
|
|
|
t.pattern = 'spec/**/*_spec.rb'
|
2016-02-08 15:37:19 -05:00
|
|
|
t.rspec_opts = ['--order', 'rand', '--color']
|
2015-03-07 12:47:24 -05:00
|
|
|
end
|
2013-10-23 00:07:51 -07:00
|
|
|
|
|
|
|
task :test do
|
2016-02-08 15:37:19 -05:00
|
|
|
sh 'bundle exec jekyll build'
|
|
|
|
Rake::Task['spec'].invoke
|
2016-03-17 17:30:47 -07:00
|
|
|
HTMLProofer.check_directory('./_site',
|
|
|
|
check_html: true,
|
2019-01-29 09:28:05 -08:00
|
|
|
enforce_https: true,
|
2016-03-17 17:30:47 -07:00
|
|
|
validation: { ignore_script_embeds: true },
|
2017-01-18 11:58:54 -08:00
|
|
|
url_swap: { %r{https://choosealicense.com} => '' },
|
2022-09-05 13:54:12 -07:00
|
|
|
url_ignore: [%r{https://github.com/github/choosealicense.com/edit/gh-pages/_licenses/},
|
|
|
|
%r{https://help.github.com},
|
|
|
|
%r{https://opensource.org}],
|
2018-10-19 11:55:08 +02:00
|
|
|
hydra: { max_concurrency: 10 },
|
2017-01-17 11:59:22 -08:00
|
|
|
check_img_http: true).run
|
2013-10-23 00:07:51 -07:00
|
|
|
end
|
2016-01-15 18:01:07 -05:00
|
|
|
|
|
|
|
task :approved_licenses do
|
|
|
|
require './spec/spec_helper'
|
|
|
|
approved = approved_licenses
|
|
|
|
approved.select! { |l| spdx_ids.include?(l) }
|
|
|
|
puts "#{approved.count} approved licenses:"
|
2016-02-08 15:37:19 -05:00
|
|
|
puts approved.join(', ')
|
2016-01-15 18:01:07 -05:00
|
|
|
puts "\n"
|
2016-01-15 18:04:07 -05:00
|
|
|
|
2017-03-26 17:19:44 -07:00
|
|
|
potential = approved - (licenses.map { |l| l['id'] })
|
2016-01-15 18:01:07 -05:00
|
|
|
puts "#{potential.count} potential additions:"
|
2016-02-08 15:37:19 -05:00
|
|
|
puts potential.join(', ')
|
2016-01-15 18:01:07 -05:00
|
|
|
end
|