Skip to content

Commit

Permalink
Merge pull request #8391 from rolandwalker/remove_unused_pathname_met…
Browse files Browse the repository at this point in the history
…hods

strip more unused methods from homebrew-fork extend/pathname.rb
  • Loading branch information
rolandwalker committed Dec 24, 2014
2 parents c23b51f + b376586 commit df23228
Showing 1 changed file with 1 addition and 35 deletions.
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

0 comments on commit df23228

Please sign in to comment.