-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathRakefile
More file actions
47 lines (39 loc) · 1.26 KB
/
Copy pathRakefile
File metadata and controls
47 lines (39 loc) · 1.26 KB
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
require "bundler/gem_tasks"
require "rake/testtask"
require "rubocop/rake_task"
require "tempfile"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"].exclude("test/integration/**/*")
end
namespace :test do
Rake::TestTask.new(:integration) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/integration/**/*_test.rb"]
end
end
RuboCop::RakeTask.new
namespace :tailwindcss do
input = "app/assets/stylesheets/pgbouncerhero/application.css"
output = "app/assets/builds/pgbouncerhero/application.css"
desc "Build Tailwind CSS"
task :build do
sh "bundle exec tailwindcss -i #{input} -o #{output} --minify"
end
desc "Verify the committed Tailwind CSS build is current"
task :check do
Tempfile.create([ "pgbouncerhero-tailwind", ".css" ]) do |file|
sh "bundle exec tailwindcss -i #{input} -o #{file.path} --minify"
abort "Tailwind CSS build is stale; run `bundle exec rake tailwindcss:build`." unless FileUtils.compare_file(output, file.path)
end
end
end
namespace :herb do
desc "Lint ERB templates with Herb"
task :lint do
sh "bundle exec herb analyze app/views"
end
end
task default: [ :test, :rubocop, "herb:lint", "tailwindcss:check" ]