Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip more unused methods from homebrew-fork extend/pathname.rb #8391

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions lib/homebrew-fork/Library/Homebrew/extend/pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"
Expand All @@ -89,18 +66,7 @@ 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"
if RUBY_VERSION == "2.0.0"
# https://bugs.ruby-lang.org/issues/9915
prepend Module.new {
def inspect
Expand Down