forked from grosser/kennel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
48 lines (42 loc) · 1.26 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# frozen_string_literal: true
require "bundler/setup"
require "bundler/gem_tasks"
require "bump/tasks"
require "json"
require "rubocop/rake_task"
RuboCop::RakeTask.new
desc "Run tests"
task :test do
sh "forking-test-runner test --merge-coverage --quiet"
end
desc "Run integration tests"
task :integration do
sh "ruby test/integration.rb"
end
desc "Turn template folder into a play area"
task :play do
require "./test/integration_helper"
include IntegrationHelper
report_fake_metric
Dir.chdir "template" do
with_test_keys_in_dotenv do
with_local_kennel do
exit! # do not run ensure blocks that clean things up
end
end
end
end
desc "Keep readmes in sync"
task :readme do
readme = File.read("Readme.md")
raise "Unable to find ADD" unless readme.gsub!(/<!-- ONLY IN .*?\n(.*?)\n-->/m, "\\1")
raise "Unable to find REMOVE" unless readme.gsub!(/<!-- NOT IN .*? -->.*?<!-- NOT IN -->\n/m, "")
raise "Unable to find images" unless readme.gsub!(/template\//, "")
File.write("template/Readme.md", readme)
sh "git diff HEAD --exit-code -- Readme.md"
end
# make sure we always run what travis runs
require "yaml"
travis = YAML.load_file(".travis.yml").fetch("env").map { |v| v.delete("TASK=") }
raise if travis.empty?
task default: travis