Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bundler/lib/bundler/templates/newgem/Gemfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ gem "rake", "~> 13.0"
<%- if config[:ext] -%>
gem "rake-compiler"
<%- end -%>

<%- if config[:test] -%>
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
<%- end -%>

<%- if config[:rubocop] -%>
gem "rubocop", "~> 0.80"
<%- end -%>
6 changes: 5 additions & 1 deletion bundler/lib/bundler/templates/newgem/Rakefile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
end

<% end -%>
task default: <%= default_task_names.size == 1 ? default_task_names.first.inspect : default_task_names.inspect %>
<% if default_task_names.size == 1 -%>
task default: <%= default_task_names.first.inspect %>
<% else -%>
task default: %i[<%= default_task_names.join(" ") %>]
<% end -%>
2 changes: 2 additions & 0 deletions bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "mkmf"

create_makefile(<%= config[:makefile_path].inspect %>)
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class <%= config[:constant_name] %>Test < Minitest::Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "<%= config[:namespaced_path] %>"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class <%= config[:constant_name] %>Test < Test::Unit::TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "<%= config[:namespaced_path] %>"

Expand Down