-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
37 lines (28 loc) · 838 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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/testtask"
test_config = lambda do |t|
t.libs << "test"
t.test_files = FileList["test/**/test_*.rb"]
end
Rake::TestTask.new(:test, &test_config)
namespace :mem do
if RbConfig::CONFIG["host_os"] == "linux"
begin
require "ruby_memcheck"
RubyMemcheck.config(binary_name: "ext")
RubyMemcheck::TestTask.new(check: "compile:dev", &test_config)
rescue LoadError
task(:check) do
abort('Please add `gem "ruby_memcheck"` to your Gemfile to use the "mem:check" task')
end
end
else
task(:check) do # rubocop:disable Rake/DuplicateTask
abort('The "mem:check" task is only available on Linux')
end
end
end
require "rubocop/rake_task"
RuboCop::RakeTask.new
task default: [:compile, :test, :rubocop]