diff options
| author | Jack Nagel | 2014-04-06 00:31:07 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-06 00:31:07 -0500 |
| commit | cfee53578664599239cb437bba01d4453c814a9c (patch) | |
| tree | 0176b57d5c3b712ee68a426dd0e3b7e442acc391 /Library | |
| parent | d0831c4ef70d6344bc63c304725d256dd86c5283 (diff) | |
| download | brew-cfee53578664599239cb437bba01d4453c814a9c.tar.bz2 | |
Remove now unnecessary realpath calls
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/log.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/versions.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 6 |
5 files changed, 9 insertions, 13 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 512e27d5b..806a8e870 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -58,18 +58,14 @@ module Homebrew extend self end def github_info f - path = f.path.realpath - - if path.to_s =~ HOMEBREW_TAP_PATH_REGEX + if f.path.to_s =~ HOMEBREW_TAP_PATH_REGEX user = $1 repo = "homebrew-#$2" path = $3 else - path.parent.cd do - user = github_fork - end + user = f.path.parent.cd { github_fork } repo = "homebrew" - path = "Library/Formula/#{path.basename}" + path = "Library/Formula/#{f.path.basename}" end "https://github.com/#{user}/#{repo}/commits/master/#{path}" diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index ca005d553..bc245850a 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -5,7 +5,7 @@ module Homebrew extend self exec "git", "log", *ARGV.options_only else begin - path = ARGV.formulae.first.path.realpath + path = ARGV.formulae.first.path rescue FormulaUnavailableError # Maybe the formula was deleted path = Formula.path(ARGV.named.first) diff --git a/Library/Homebrew/cmd/versions.rb b/Library/Homebrew/cmd/versions.rb index fa38cfca6..563e1588f 100644 --- a/Library/Homebrew/cmd/versions.rb +++ b/Library/Homebrew/cmd/versions.rb @@ -65,7 +65,7 @@ class Formula private def repository @repository ||= begin - if path.realpath.to_s =~ HOMEBREW_TAP_DIR_REGEX + if path.to_s =~ HOMEBREW_TAP_DIR_REGEX HOMEBREW_REPOSITORY/"Library/Taps/#$1-#$2" else HOMEBREW_REPOSITORY diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 8c1c46998..56a3f7dc7 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -196,7 +196,7 @@ class BuildError < Homebrew::InstallationError unless formula.core_formula? ohai "Formula" puts "Tap: #{formula.tap}" - puts "Path: #{formula.path.realpath}" + puts "Path: #{formula.path}" end ohai "Configuration" Homebrew.dump_build_config diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index d4225261a..5673c898a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -404,11 +404,11 @@ class Formula end def tap? - !!path.realpath.to_s.match(HOMEBREW_TAP_DIR_REGEX) + HOMEBREW_TAP_DIR_REGEX === path end def tap - if path.realpath.to_s =~ HOMEBREW_TAP_DIR_REGEX + if path.to_s =~ HOMEBREW_TAP_DIR_REGEX "#$1/#$2" elsif core_formula? "Homebrew/homebrew" @@ -419,7 +419,7 @@ class Formula # True if this formula is provided by Homebrew itself def core_formula? - path.realpath == Formula.path(name) + path == Formula.path(name) end def self.path name |
