diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/gem.rb | 7 | ||||
-rw-r--r-- | lib/bundler/templates/newgem/newgem.gemspec.tt | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index b75ec9bc0f..bc441e5b8b 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -74,6 +74,7 @@ module Bundler required_ruby_version: required_ruby_version, rust_builder_required_rubygems_version: rust_builder_required_rubygems_version, minitest_constant_name: minitest_constant_name, + ignore_files: %w[bin/ test/ spec/ features/ .git appveyor Gemfile], } ensure_safe_gem_name(name, constant_array) @@ -135,13 +136,13 @@ module Bundler case config[:ci] when "github" templates.merge!("github/workflows/main.yml.tt" => ".github/workflows/main.yml") - config[:ci_config_path] = ".github " + config[:ignore_files] << ".github" when "gitlab" templates.merge!("gitlab-ci.yml.tt" => ".gitlab-ci.yml") - config[:ci_config_path] = ".gitlab-ci.yml " + config[:ignore_files] << ".gitlab-ci.yml" when "circle" templates.merge!("circleci/config.yml.tt" => ".circleci/config.yml") - config[:ci_config_path] = ".circleci " + config[:ignore_files] << ".circleci" end if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?", diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index ced300f379..2f068a4225 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| ls.readlines("\x0", chomp: true).reject do |f| (f == gemspec) || - f.start_with?(*%w[bin/ test/ spec/ features/ .git <%= config[:ci_config_path] %>appveyor Gemfile]) + f.start_with?(*%w[<%= config[:ignore_files].join(" ") %>]) end end spec.bindir = "exe" |