diff options
author | Masha <no.public@email.sorry> | 2020-02-09 19:01:28 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-02-27 09:42:20 +0100 |
commit | 7dc699ddc454161f5f2418c0d1ccb9885ee10078 (patch) | |
tree | b98da31c30e220fa7efa2c94a0e3bcf6f1bcaee0 | |
parent | b317cb7b9ae5abc48b44942fff632f52d8287d20 (diff) | |
download | bundler-7dc699ddc454161f5f2418c0d1ccb9885ee10078.tar.gz |
Adhere to gemfile name preference also for project skeleton
-rw-r--r-- | lib/bundler.rb | 4 | ||||
-rw-r--r-- | lib/bundler/cli/gem.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/init.rb | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 1f7f2f14af..23ed848d86 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -457,6 +457,10 @@ EOF Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir end + def preferred_gemfile_name + Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile" + end + def use_system_gems? configured_bundle_path.use_system_gems? end diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 00b3bc55a6..3fd67d9a88 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -63,7 +63,7 @@ module Bundler ensure_safe_gem_name(name, constant_array) templates = { - "Gemfile.tt" => "Gemfile", + "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name, "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb", "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb", "newgem.gemspec.tt" => "#{name}.gemspec", diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 65dd08dfe9..f45871ce9c 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -41,7 +41,7 @@ module Bundler private def gemfile - @gemfile ||= Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile" + @gemfile ||= Bundler.preferred_gemfile_name end end end |