forked from SciRuby/rubyplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (35 loc) · 874 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
require "bundler/gem_tasks"
require "rake"
require 'rake/extensiontask'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
require 'rubocop/rake_task'
RuboCop::RakeTask.new
desc 'Default: run unit specs.'
task :default => [:spec, :rubocop]
task :test => ["test:magick", "test:gr"]
namespace :test do
task :gr do
ENV['RUBYPLOT_BACKEND'] = "GR"
Rake::Task["spec"].reenable
Rake::Task["spec"].invoke
end
task :magick do
ENV['RUBYPLOT_BACKEND'] = "MAGICK"
Rake::Task["spec"].reenable
Rake::Task["spec"].invoke
end
end
gemspec = eval(IO.read('rubyplot.gemspec'))
ext_name = 'grruby'
Rake::ExtensionTask.new(ext_name, gemspec) do |ext|
ext.ext_dir = "ext/#{ext_name}"
ext.source_pattern = '**/*.{c,h}'
end
def run(*cmd)
sh(cmd.join(' '))
end
task :pry do |_task|
cmd = ['pry', "-r './lib/rubyplot.rb' "]
run(*cmd)
end