diff options
| author | Mike McQuaid | 2013-10-30 13:20:48 -0700 | 
|---|---|---|
| committer | Mike McQuaid | 2013-10-30 13:20:48 -0700 | 
| commit | 2183cd8d5573a9fbc7ce914422411932c1eae770 (patch) | |
| tree | 633c1835d2012ed66b1e96d7aea6f2c31655ea36 | |
| parent | 989cad391270498b558fbd6b1a664f1bb4b3d3b0 (diff) | |
| download | homebrew-2183cd8d5573a9fbc7ce914422411932c1eae770.tar.bz2 | |
Cleanup use of some global constants.
| -rwxr-xr-x | Library/Contributions/cmd/brew-test-bot.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/create.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/edit.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/tap.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/super.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/global.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_formula.rb | 2 | ||||
| -rwxr-xr-x | Library/brew.rb | 2 | 
10 files changed, 15 insertions, 16 deletions
| diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb index cba5375e1..1cd22b114 100755 --- a/Library/Contributions/cmd/brew-test-bot.rb +++ b/Library/Contributions/cmd/brew-test-bot.rb @@ -19,7 +19,6 @@ require 'rexml/xmldecl'  require 'rexml/cdata'  EMAIL_SUBJECT_FILE = "brew-test-bot.#{MacOS.cat}.email.txt" -HOMEBREW_CONTRIBUTED_CMDS = HOMEBREW_REPOSITORY + "Library/Contributions/cmd/"  class Step    attr_reader :command, :name, :status, :output, :time diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb index c41a80be3..06d45555d 100644 --- a/Library/Homebrew/cmd/create.rb +++ b/Library/Homebrew/cmd/create.rb @@ -118,7 +118,7 @@ class FormulaCreator      require 'formula'      # Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook -    #                #{HOMEBREW_PREFIX}/Library/Contributions/example-formula.rb +    #                #{HOMEBREW_CONTRIB}/example-formula.rb      # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!      class #{Formula.class_s name} < Formula diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index d41c539dc..b306b5850 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -926,7 +926,7 @@ def check_git_status        If this a surprise to you, then you should stash these modifications.        Stashing returns Homebrew to a pristine state but can be undone        should you later need to do so for some reason. -          cd #{HOMEBREW_REPOSITORY}/Library && git stash && git clean -d -f +          cd #{HOMEBREW_LIBRARY} && git stash && git clean -d -f        EOS      end    end @@ -1032,7 +1032,7 @@ def check_for_outdated_homebrew      timestamp = if File.directory? ".git"        `git log -1 --format="%ct" HEAD`.to_i      else -      (HOMEBREW_REPOSITORY/"Library").mtime.to_i +      HOMEBREW_LIBRARY.mtime.to_i      end      if Time.now.to_i - timestamp > 60 * 60 * 24 then <<-EOS.undent diff --git a/Library/Homebrew/cmd/edit.rb b/Library/Homebrew/cmd/edit.rb index f5635fa81..4e3298c3f 100644 --- a/Library/Homebrew/cmd/edit.rb +++ b/Library/Homebrew/cmd/edit.rb @@ -43,7 +43,7 @@ module Homebrew extend self    end    def library_folders -    Dir["#{HOMEBREW_REPOSITORY}/Library/*"].reject do |d| +    Dir["#{HOMEBREW_LIBRARY}/*"].reject do |d|        case File.basename(d) when 'LinkedKegs', 'Aliases' then true end      end    end diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 21ad00c6e..2b17629a5 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -83,7 +83,7 @@ module Homebrew extend self    def repair_taps      count = 0      # prune dead symlinks in Formula -    Dir["#{HOMEBREW_REPOSITORY}/Library/Formula/*.rb"].each do |fn| +    Dir["#{HOMEBREW_LIBRARY}/Formula/*.rb"].each do |fn|        if not File.exist? fn          File.delete fn          count += 1 diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 169a4200c..6c05bddb4 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -185,7 +185,7 @@ module Superenv    end    def determine_pkg_config_libdir -    paths = %W{/usr/lib/pkgconfig #{HOMEBREW_REPOSITORY}/Library/ENV/pkgconfig/#{MacOS.version}} +    paths = %W{/usr/lib/pkgconfig #{HOMEBREW_LIBRARY}/ENV/pkgconfig/#{MacOS.version}}      paths << "#{MacOS::X11.lib}/pkgconfig" << "#{MacOS::X11.share}/pkgconfig" if x11?      paths.to_path_s    end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 92b7d40a0..9190371dd 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -362,7 +362,7 @@ class Formula    # an array of all Formula names    def self.names -    Dir["#{HOMEBREW_REPOSITORY}/Library/Formula/*.rb"].map{ |f| File.basename f, '.rb' }.sort +    Dir["#{HOMEBREW_LIBRARY}/Formula/*.rb"].map{ |f| File.basename f, '.rb' }.sort    end    def self.each @@ -393,7 +393,7 @@ class Formula    end    def self.aliases -    Dir["#{HOMEBREW_REPOSITORY}/Library/Aliases/*"].map{ |f| File.basename f }.sort +    Dir["#{HOMEBREW_LIBRARY}/Aliases/*"].map{ |f| File.basename f }.sort    end    # TODO - document what this returns and why @@ -402,7 +402,7 @@ class Formula      if name.include? "/"        if name =~ %r{(.+)/(.+)/(.+)}          tap_name = "#$1-#$2".downcase -        tapd = Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Taps/#{tap_name}") +        tapd = Pathname.new("#{HOMEBREW_LIBRARY}/Taps/#{tap_name}")          tapd.find_formula do |relative_pathname|            return "#{tapd}/#{relative_pathname}" if relative_pathname.stem.to_s == $3          end if tapd.directory? @@ -412,13 +412,13 @@ class Formula      end      # test if the name is a core formula -    formula_with_that_name = Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Formula/#{name}.rb") +    formula_with_that_name = Pathname.new("#{HOMEBREW_LIBRARY}/Formula/#{name}.rb")      if formula_with_that_name.file? and formula_with_that_name.readable?        return name      end      # test if the name is a formula alias -    possible_alias = Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Aliases/#{name}") +    possible_alias = Pathname.new("#{HOMEBREW_LIBRARY}/Aliases/#{name}")      if possible_alias.file?        return possible_alias.realpath.basename('.rb').to_s      end @@ -457,7 +457,7 @@ class Formula    end    def self.path name -    Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Formula/#{name.downcase}.rb") +    Pathname.new("#{HOMEBREW_LIBRARY}/Formula/#{name.downcase}.rb")    end    def env diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 12e77c407..1a5d2efaa 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -84,7 +84,7 @@ HOMEBREW_USER_AGENT = "Homebrew #{HOMEBREW_VERSION} (Ruby #{RUBY_VERSION}-#{RUBY  HOMEBREW_CURL_ARGS = '-f#LA'  HOMEBREW_TAP_FORMULA_REGEX = %r{^(\w+)/(\w+)/([^/]+)$} -HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_REPOSITORY}/Library/Taps/(\w+)-(\w+)} +HOMEBREW_TAP_DIR_REGEX = %r{#{HOMEBREW_LIBRARY}/Taps/(\w+)-(\w+)}  HOMEBREW_TAP_PATH_REGEX = Regexp.new(HOMEBREW_TAP_DIR_REGEX.source \                                       + %r{/(.*)}.source) diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index 9f815166f..dbecaa8e1 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/test/test_formula.rb @@ -190,7 +190,7 @@ class FormulaTests < Test::Unit::TestCase    def test_path      name = 'foo-bar' -    assert_equal Pathname.new("#{HOMEBREW_REPOSITORY}/Library/Formula/#{name}.rb"), Formula.path(name) +    assert_equal Pathname.new("#{HOMEBREW_LIBRARY}/Formula/#{name}.rb"), Formula.path(name)    end    def test_factory diff --git a/Library/brew.rb b/Library/brew.rb index 0c1aef812..dad310e84 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -90,7 +90,7 @@ begin    end    # Add contributed commands to PATH before checking. -  ENV['PATH'] += ":#{HOMEBREW_REPOSITORY}/Library/Contributions/cmd" +  ENV['PATH'] += ":#{HOMEBREW_CONTRIB}/cmd"    if require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd      Homebrew.send cmd.to_s.gsub('-', '_').downcase    elsif which "brew-#{cmd}" | 
