-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
38 lines (31 loc) · 909 Bytes
/
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
require "bundler/setup"
require "fileutils"
require "rspec/core/rake_task"
require "bundler/gem_tasks"
require "sprockets/standalone"
# Test tasks
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
task coverage: :"assets:remove" do
ENV["COVERAGE"] = "true"
Rake::Task["spec"].invoke
end
end
task default: :spec
# Release tasks
Sprockets::Standalone::RakeTask.new(:assets) do |task, sprockets|
require_relative "app/config/sprockets"
task.assets = %w(app.js app.css *.eot *.svg *.ttf *.woff *woff2)
task.sources = %w(app/assets)
task.output = "app/public/assets"
task.compress = true
task.digest = false
task.environment = Octodmin.sprockets
end
namespace :assets do
task :remove do
FileUtils.rm_r("./tmp/sprockets", force: true)
FileUtils.rm_r("./app/public/assets", force: true)
end
end
Rake::Task["build"].enhance([:"assets:remove", :"assets:compile"])