Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 25aa878ef7fc
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c7aeff893b77
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on Oct 7, 2015

  1. Rename #remove_tailing_slash (tailing -> trailing)

    - Renames FileUtils#remove_tailing_slash (to #remove_trailing_slash)
    - Addresses #3372, repairing the private method name
    rthbound committed Oct 7, 2015
    Copy the full SHA
    0d2f510 View commit details

Commits on Oct 8, 2015

  1. Merge pull request #3373 from rthbound/rthbound-patch-1-fix-method-name

    Rename #remove_tailing_slash (tailing -> trailing)
    headius committed Oct 8, 2015
    Copy the full SHA
    c7aeff8 View commit details
10 changes: 5 additions & 5 deletions lib/ruby/stdlib/fileutils.rb
Original file line number Diff line number Diff line change
@@ -156,10 +156,10 @@ def uptodate?(new, old_list)
end
module_function :uptodate?

def remove_tailing_slash(dir)
def remove_trailing_slash(dir)
dir == '/' ? dir : dir.chomp(?/)
end
private_module_function :remove_tailing_slash
private_module_function :remove_trailing_slash

#
# Options: mode noop verbose
@@ -207,7 +207,7 @@ def mkdir_p(list, options = {})
fu_output_message "mkdir -p #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}" if options[:verbose]
return *list if options[:noop]

list.map {|path| remove_tailing_slash(path)}.each do |path|
list.map {|path| remove_trailing_slash(path)}.each do |path|
# optimize for the most common case
begin
fu_mkdir path, options[:mode]
@@ -244,7 +244,7 @@ def mkdir_p(list, options = {})
OPT_TABLE['makedirs'] = [:mode, :noop, :verbose]

def fu_mkdir(path, mode) #:nodoc:
path = remove_tailing_slash(path)
path = remove_trailing_slash(path)
if mode
Dir.mkdir path, mode
File.chmod mode, path
@@ -272,7 +272,7 @@ def rmdir(list, options = {})
return if options[:noop]
list.each do |dir|
begin
Dir.rmdir(dir = remove_tailing_slash(dir))
Dir.rmdir(dir = remove_trailing_slash(dir))
if parents
until (parent = File.dirname(dir)) == '.' or parent == dir
dir = parent
2 changes: 1 addition & 1 deletion test/mri/excludes_truffle/TestFileUtilsDryRun.rb
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
exclude :test_visibility_remove_entry, "needs investigation"
exclude :test_visibility_remove_entry_secure, "needs investigation"
exclude :test_visibility_remove_file, "needs investigation"
exclude :test_visibility_remove_tailing_slash, "needs investigation"
exclude :test_visibility_remove_trailing_slash, "needs investigation"
exclude :test_visibility_rename_cannot_overwrite_file, "needs investigation"
exclude :test_visibility_rm, "needs investigation"
exclude :test_visibility_rm_f, "needs investigation"
2 changes: 1 addition & 1 deletion test/mri/excludes_truffle/TestFileUtilsNoWrite.rb
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
exclude :test_visibility_remove_entry, "needs investigation"
exclude :test_visibility_remove_entry_secure, "needs investigation"
exclude :test_visibility_remove_file, "needs investigation"
exclude :test_visibility_remove_tailing_slash, "needs investigation"
exclude :test_visibility_remove_trailing_slash, "needs investigation"
exclude :test_visibility_rename_cannot_overwrite_file, "needs investigation"
exclude :test_visibility_rm, "needs investigation"
exclude :test_visibility_rm_f, "needs investigation"
2 changes: 1 addition & 1 deletion test/mri/excludes_truffle/TestFileUtilsVerbose.rb
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
exclude :test_visibility_remove_entry, "needs investigation"
exclude :test_visibility_remove_entry_secure, "needs investigation"
exclude :test_visibility_remove_file, "needs investigation"
exclude :test_visibility_remove_tailing_slash, "needs investigation"
exclude :test_visibility_remove_trailing_slash, "needs investigation"
exclude :test_visibility_rename_cannot_overwrite_file, "needs investigation"
exclude :test_visibility_rm, "needs investigation"
exclude :test_visibility_rm_f, "needs investigation"