From 26785dbe5ddaee3f71d64d4a9f8b92274ec3a366 Mon Sep 17 00:00:00 2001 From: Jack Nagel <jacknagel@gmail.com> Date: Fri, 28 Feb 2014 16:51:15 -0600 Subject: [PATCH] Use Formula.path --- Library/Homebrew/cmd/edit.rb | 2 +- Library/Homebrew/cmd/install.rb | 2 +- Library/Homebrew/cmd/log.rb | 2 +- Library/Homebrew/formula.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cmd/edit.rb b/Library/Homebrew/cmd/edit.rb index 4e3298c3f5..4389087d4a 100644 --- a/Library/Homebrew/cmd/edit.rb +++ b/Library/Homebrew/cmd/edit.rb @@ -30,7 +30,7 @@ module Homebrew extend self if name.include? '/' Pathname.new(name) else - HOMEBREW_REPOSITORY+"Library/Formula/#{name}.rb" + Formula.path(name) end end unless ARGV.force? diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 4e1705c74b..cd3c3c8d25 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -25,7 +25,7 @@ module Homebrew extend self ARGV.named.each do |name| # if a formula has been tapped ignore the blacklisting - if not File.file? HOMEBREW_REPOSITORY/"Library/Formula/#{name}.rb" + unless Formula.path(name).file? msg = blacklisted? name raise "No available formula for #{name}\n#{msg}" if msg end diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 5f0ef63c8e..ca005d553f 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -8,7 +8,7 @@ module Homebrew extend self path = ARGV.formulae.first.path.realpath rescue FormulaUnavailableError # Maybe the formula was deleted - path = HOMEBREW_REPOSITORY/"Library/Formula/#{ARGV.named.first}.rb" + path = Formula.path(ARGV.named.first) end cd path.dirname # supports taps exec "git", "log", *ARGV.options_only + ["--", path] diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 141f126362..c632fba2e7 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -403,7 +403,7 @@ class Formula end # test if the name is a core formula - formula_with_that_name = Pathname.new("#{HOMEBREW_LIBRARY}/Formula/#{name}.rb") + formula_with_that_name = Formula.path(name) if formula_with_that_name.file? and formula_with_that_name.readable? return name end -- GitLab