Sha256: 9084f491bd0f52afb69f871fa76dcc18d85b4b79cada3773dae7cc6e5637a4ef

Contents?: true

Size: 1.61 KB

Versions: 55

Compression:

Stored size: 1.61 KB

Contents

# frozen_string_literal: true

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

Minitest::TestTask.create

<% 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

55 entries across 55 versions & 3 rubygems

Version Path
rubygems-update-3.6.3 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.6.3 lib/bundler/templates/newgem/Rakefile.tt
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/bundler-2.5.5/lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.6.2 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.6.2 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.6.1 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.6.1 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.6.0 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.6.0 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.5.23 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.5.23 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.5.22 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.5.22 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.5.21 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.5.21 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.5.20 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.5.20 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.5.19 bundler/lib/bundler/templates/newgem/Rakefile.tt
bundler-2.5.19 lib/bundler/templates/newgem/Rakefile.tt
rubygems-update-3.5.18 bundler/lib/bundler/templates/newgem/Rakefile.tt