Skip to content

Commit

Permalink
Ronn pages shouldn't be installed either
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Oct 5, 2020
1 parent 186e62c commit 67dd605
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/rubygems/commands/setup_command.rb
Expand Up @@ -521,14 +521,14 @@ def files_in(dir)
# for installation of bundler as default gems
def bundler_man1_files_in(dir)
Dir.chdir dir do
Dir['bundle*.1{,.ronn}']
Dir['bundle*.1']
end
end

# for installation of bundler as default gems
def bundler_man5_files_in(dir)
Dir.chdir dir do
Dir['gemfile.5{,.ronn}']
Dir['gemfile.5']
end
end

Expand Down Expand Up @@ -592,7 +592,7 @@ def remove_old_man_files(man_dir)

old_man1_dir = "#{old_man_dir}/man1"
old_man1_files = bundler_man1_files_in(old_man1_dir)
old_man1_files += Dir.chdir(old_man1_dir) { Dir["bundle*.1.txt"] }
old_man1_files += Dir.chdir(old_man1_dir) { Dir["bundle*.1.{txt,ronn}"] }

man1_to_remove = old_man1_files - man1_files

Expand All @@ -602,7 +602,7 @@ def remove_old_man_files(man_dir)

old_man5_dir = "#{old_man_dir}/man5"
old_man5_files = bundler_man5_files_in(old_man5_dir)
old_man1_files += Dir.chdir(old_man5_dir) { Dir["gemfile.5.txt"] }
old_man5_files += Dir.chdir(old_man5_dir) { Dir["gemfile.5.{txt,ronn}"] }

man5_to_remove = old_man5_files - man5_files

Expand Down
12 changes: 6 additions & 6 deletions test/rubygems/test_gem_commands_setup_command.rb
Expand Up @@ -161,12 +161,12 @@ def test_files_in
end

def test_bundler_man1_files_in
assert_equal %w[bundle-b.1 bundle-b.1.ronn],
assert_equal %w[bundle-b.1],
@cmd.bundler_man1_files_in('bundler/man').sort
end

def test_bundler_man5_files_in
assert_equal %w[gemfile.5 gemfile.5.ronn],
assert_equal %w[gemfile.5],
@cmd.bundler_man5_files_in('bundler/man').sort
end

Expand Down Expand Up @@ -194,9 +194,9 @@ def test_install_man
@cmd.install_man dir

assert_path_exists File.join("#{dir}/man1", 'bundle-b.1')
assert_path_exists File.join("#{dir}/man1", 'bundle-b.1.ronn')
refute_path_exists File.join("#{dir}/man1", 'bundle-b.1.ronn')
assert_path_exists File.join("#{dir}/man5", 'gemfile.5')
assert_path_exists File.join("#{dir}/man5", 'gemfile.5.ronn')
refute_path_exists File.join("#{dir}/man5", 'gemfile.5.ronn')
end
end

Expand Down Expand Up @@ -308,8 +308,8 @@ def test_remove_old_man_files
gemfile_5_ronn = File.join man, 'man5', 'gemfile.5.ronn'
gemfile_5_txt = File.join man, 'man5', 'gemfile.5.txt'

files_that_go = [bundle_b_1_txt, gemfile_5_txt]
files_that_stay = [ruby_1, bundle_b_1, bundle_b_1_ronn, gemfile_5, gemfile_5_ronn]
files_that_go = [bundle_b_1_txt, bundle_b_1_ronn, gemfile_5_txt, gemfile_5_ronn]
files_that_stay = [ruby_1, bundle_b_1, gemfile_5]

create_dummy_files(files_that_go + files_that_stay)

Expand Down

0 comments on commit 67dd605

Please sign in to comment.