-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
34 lines (28 loc) · 891 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
require_relative "config/setup"
require "grape/activerecord/rake"
require "rspec/core/rake_task"
ENV["SIMPLECOV_NO_DEFAULTS"] = "true"
require "simplecov"
ENV["SIMPLECOV_NO_DEFAULTS"] = nil
RSpec::Core::RakeTask.new :spec
desc "Push coverage data to codecov"
task "spec:codecov": [:spec] do
require "codecov"
SimpleCov::Formatter::Codecov.new.format(SimpleCov.result)
end
desc "Generates a HTML report of SimpleCov data"
task "spec:html_report": [:spec] do
require "simplecov-html"
SimpleCov::Formatter::HTMLFormatter.new.format(SimpleCov.result)
end
task ci: ["db:migrate", "spec", "spec:codecov"]
desc "Print compiled grape routes"
task :routes do
class API < Grape::API
mount APIv1 => "/v1"
end
API.routes.each do |route|
version = route.route_version ? "(#{route.route_version}) " : ""
puts "#{version}#{route.route_method} #{route.route_path}"
end
end