summaryrefslogtreecommitdiff
path: root/lib/bundler/templates/newgem/Rakefile.tt
blob: 1262457c72c003804274cc5e9e8f982e41fc39c2 (plain)
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
require "bundler/gem_tasks"
<% default_task_names = [config[:test_task]] -%>
<% if config[:test] == "minitest" -%>
require "rake/testtask"

Rake::TestTask.new(:test) do |t|
  t.libs << "test"
  t.libs << "lib"
  t.test_files = FileList["test/**/*_test.rb"]
end

<% elsif config[:test] == "rspec" -%>
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

<% end -%>
<% if config[:rubocop] -%>
<% default_task_names << :rubocop -%>
require "rubocop/rake_task"

RuboCop::RakeTask.new

<% end -%>
<% if config[:ext] -%>
<% default_task_names.unshift(:clobber, :compile) -%>
require "rake/extensiontask"

task :build => :compile

Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
  ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
end

<% end -%>
task :default => <%= default_task_names.size == 1 ? default_task_names.first.inspect : default_task_names.inspect %>