Skip to content

Commit 8eb4c56

Browse files
committed
Auto merge of #2065 - rubygems:add-bundler-template, r=indirect
Added template files to vendoerd bundler. Fixes #2062 # Description: Current installer ignored *.tt or non-extension files. I added `bundler/templates/**/*` files when installing vendoered bundler.
2 parents f415530 + ac44487 commit 8eb4c56

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/rubygems/commands/setup_command.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ def install_lib(lib_dir)
294294
say "Installing #{tool}" if @verbose
295295

296296
lib_files = rb_files_in path
297+
lib_files.concat(template_files) if tool == 'Bundler'
298+
297299
pem_files = pem_files_in path
298300

299301
Dir.chdir path do
@@ -433,6 +435,12 @@ def rb_files_in dir
433435
end
434436
end
435437

438+
def template_files
439+
Dir.chdir "bundler/lib" do
440+
Dir[File.join('bundler', 'templates', '**', '*')].select{|f| !File.directory?(f)}
441+
end
442+
end
443+
436444
def remove_old_bin_files(bin_dir)
437445
old_bin_files = {
438446
'gem_mirror' => 'gem mirror',
@@ -470,8 +478,10 @@ def remove_old_lib_files lib_dir
470478
lib_dirs[File.join(lib_dir, 'bundler')] = 'bundler/lib/bundler' if Gem::USE_BUNDLER_FOR_GEMDEPS
471479
lib_dirs.each do |old_lib_dir, new_lib_dir|
472480
lib_files = rb_files_in(new_lib_dir)
481+
lib_files.concat(template_files) if new_lib_dir =~ /bundler/
473482

474483
old_lib_files = rb_files_in(old_lib_dir)
484+
old_lib_files.concat(template_files) if old_lib_dir =~ /bundler/
475485

476486
to_remove = old_lib_files - lib_files
477487

0 commit comments

Comments
 (0)