From 72fa49b1b17e10ec20563993a852f9b8e8dd39f5 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Tue, 23 Dec 2014 12:09:55 -0500 Subject: [PATCH 1/2] whitespace --- lib/homebrew-fork/Library/Homebrew/extend/pathname.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb b/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb index 19ed1d2d777cd..a66c77d4673f7 100644 --- a/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb +++ b/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb @@ -100,7 +100,7 @@ def ensure_writable chmod saved_perms if saved_perms end - if RUBY_VERSION == "2.0.0" + if RUBY_VERSION == "2.0.0" # https://bugs.ruby-lang.org/issues/9915 prepend Module.new { def inspect From b37658656e34afc4d7734a6a4f3874324ae42997 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Tue, 23 Dec 2014 12:10:57 -0500 Subject: [PATCH 2/2] strip more unused methods from extend/pathname.rb in homebrew-fork --- .../Library/Homebrew/extend/pathname.rb | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb b/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb index a66c77d4673f7..430e78d40cd0b 100644 --- a/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb +++ b/lib/homebrew-fork/Library/Homebrew/extend/pathname.rb @@ -42,12 +42,6 @@ def rmdir_if_possible false end - def chmod_R perms - opoo "Pathname#chmod_R is deprecated, use FileUtils.chmod_R" - require 'fileutils' - FileUtils.chmod_R perms, to_s - end - def version require 'version' Version.parse(self) @@ -64,23 +58,6 @@ def cd Dir.chdir(self){ yield } end - def subdirs - children.select{ |child| child.directory? } - end - - def resolved_path - self.symlink? ? dirname+readlink : self - end - - def resolved_path_exists? - link = readlink - rescue ArgumentError - # The link target contains NUL bytes - false - else - (dirname+link).exist? - end - def /(other) unless other.respond_to?(:to_str) || other.respond_to?(:to_path) opoo "Pathname#/ called on #{inspect} with #{other.inspect} as an argument" @@ -89,17 +66,6 @@ def /(other) self + other.to_s end unless method_defined?(:/) - def ensure_writable - saved_perms = nil - unless writable_real? - saved_perms = stat.mode - chmod 0644 - end - yield - ensure - chmod saved_perms if saved_perms - end - if RUBY_VERSION == "2.0.0" # https://bugs.ruby-lang.org/issues/9915 prepend Module.new {