Sha256: 27dc55ebc4631454de3cdce3123509062211efce76ca0902f0f7b56defe401dd

Contents?: true

Size: 1.7 KB

Versions: 82

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

require "bundler/gem_tasks"
<% default_task_names = [config[:test_task]].compact -%>
<% case config[:test] -%>
<% when "minitest" -%>
require "rake/testtask"

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

<% when "test-unit" -%>
require "rake/testtask"

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

<% when "rspec" -%>
require "rspec/core/rake_task"

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

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

RuboCop::RakeTask.new

<% elsif config[:linter] == "standard" -%>
<% default_task_names << :standard -%>
require "standard/rake"

<% end -%>
<% if config[:ext] -%>
<% default_task_names.unshift(:compile) -%>
<% default_task_names.unshift(:clobber) unless config[:ext] == 'rust' -%>
<% if config[:ext] == 'rust' -%>
require "rb_sys/extensiontask"

task build: :compile

GEMSPEC = Gem::Specification.load("<%= config[:underscored_name] %>.gemspec")

RbSys::ExtensionTask.new(<%= config[:name].inspect %>, GEMSPEC) do |ext|
  ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
end
<% else -%>
require "rake/extensiontask"

task build: :compile

GEMSPEC = Gem::Specification.load("<%= config[:underscored_name] %>.gemspec")

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

<% end -%>
<% if default_task_names.size == 1 -%>
task default: <%= default_task_names.first.inspect %>
<% else -%>
task default: %i[<%= default_task_names.join(" ") %>]
<% end -%>

Version data entries

82 entries across 82 versions & 4 rubygems

Version Path
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.8 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.7 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.6 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.5 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.4 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.3 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.2 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.1 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.2.0 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.1.99 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.1.98 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt
harbr-0.1.97 vendor/bundle/ruby/3.2.0/gems/bundler-2.4.21/lib/bundler/templates/newgem/Rakefile.tt