-
-
Notifications
You must be signed in to change notification settings - Fork 190
/
Rakefile
46 lines (34 loc) · 973 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
39
40
41
42
43
44
45
46
# frozen_string_literal: true
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
# # temp fix for NoMethodError: undefined method `last_comment'
# # remove when fixed in Rake 11.x and higher
# module TempFixForRakeLastComment
# def last_comment
# last_description
# end
# end
# Rake::Application.send :include, TempFixForRakeLastComment
# ### end of tempfix
RSpec::Core::RakeTask.new(:spec)
require "rubocop/rake_task"
RuboCop::RakeTask.new
require "rake/extensiontask"
if RUBY_ENGINE == 'jruby'
task default: %i[spec]
else
task build: :compile
Rake::ExtensionTask.new("smarter_csv") do |ext|
ext.lib_dir = "lib/smarter_csv"
ext.ext_dir = "ext/smarter_csv"
ext.source_pattern = "*.{c,h}"
end
# task default: %i[clobber compile spec rubocop]
task default: %i[clobber compile spec]
end
desc 'Run spec with coverage'
task :coverage do
ENV['COVERAGE'] = 'true'
Rake::Task['spec'].execute
`open coverage/index.html`
end