diff options
| author | Jack Nagel | 2014-05-27 21:14:59 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-05-27 21:16:15 -0500 |
| commit | 69b1b0844ad782433d3913c687ec271cba797a8d (patch) | |
| tree | d2036cbbd89f55894d66b63a136ddacdc4d2288c /Library | |
| parent | bd52a15621153450fca3537239467532981af8b3 (diff) | |
| download | homebrew-69b1b0844ad782433d3913c687ec271cba797a8d.tar.bz2 | |
Make some constant strings into actual constants
We only need one copy of each of these strings, not ~7500.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/software_spec.rb | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index f9a6e968f..e9e39d49c 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -9,7 +9,7 @@ require 'extend/pathname' BOTTLE_ERB = <<-EOS bottle do - <% if root_url != BottleSpecification.new.root_url %> + <% if root_url != BottleSpecification::DEFAULT_ROOT_URL %> root_url "<%= root_url %>" <% end %> <% if prefix.to_s != "/usr/local" %> diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 0e6dddc89..77ad7d42c 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -148,14 +148,18 @@ class Bottle end class BottleSpecification + DEFAULT_PREFIX = "/usr/local".freeze + DEFAULT_CELLAR = "/usr/local/Cellar".freeze + DEFAULT_ROOT_URL = "https://downloads.sf.net/project/machomebrew/Bottles".freeze + attr_rw :root_url, :prefix, :cellar, :revision attr_reader :checksum, :collector def initialize @revision = 0 - @prefix = '/usr/local' - @cellar = '/usr/local/Cellar' - @root_url = 'https://downloads.sf.net/project/machomebrew/Bottles' + @prefix = DEFAULT_PREFIX + @cellar = DEFAULT_CELLAR + @root_url = DEFAULT_ROOT_URL @collector = BottleCollector.new end |
