mirror of
https://github.com/github/choosealicense.com
synced 2024-11-05 03:08:51 +01:00
09a17298ab
- explicitly include jekyll-coffeescript needed per http://jekyllrb.com/docs/upgrading/2-to-3/ - option to html-proofer to ignore script embeds; uncertain why warnings appeared post upgrade as it doesn't seem that either jekyll-seo-tag or html-proofer got new versions in https://github.com/github/choosealicense.com/pull/339/files but suppressed now in any case.
30 lines
838 B
Ruby
30 lines
838 B
Ruby
require "html/proofer"
|
|
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
|
|
|
|
task :test do
|
|
sh "bundle exec jekyll build --trace"
|
|
Rake::Task["spec"].invoke
|
|
HTML::Proofer.new("./_site", :check_html => true,
|
|
:validation => { :ignore_script_embeds => true },
|
|
:href_swap => { %r{http://choosealicense.com} => "" }).run
|
|
end
|
|
|
|
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"
|
|
|
|
potential = approved - licenses.map { |l| l["id"] }
|
|
puts "#{potential.count} potential additions:"
|
|
puts potential.join(", ")
|
|
end
|