-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
35 lines (24 loc) · 831 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
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(spec: :compile)
require "rubocop/rake_task"
RuboCop::RakeTask.new
require "rake/extensiontask"
task build: :compile
task package: :build
task pkg: :build
GEMSPEC = Gem::Specification.load("json_scanner.gemspec")
Rake::ExtensionTask.new("json_scanner", GEMSPEC) do |ext|
ext.lib_dir = "lib/json_scanner"
# https://karottenreibe.github.io/2009/10/30/ruby-c-extension-7/
end
task default: %i[clobber compile spec rubocop]
if RUBY_VERSION >= "2.5"
require "ruby_memcheck"
require "ruby_memcheck/rspec/rake_task"
RubyMemcheck.config(skipped_ruby_functions: %w[rb_utf8_str_new_cstr rb_exc_new_str rb_exc_raise])
namespace :spec do
RubyMemcheck::RSpec::RakeTask.new(valgrind: :compile)
end
end