Make some constant strings into actual constants
We only need one copy of each of these strings, not ~7500.
This commit is contained in:
parent
28fa5b0261
commit
33cdff99ba
@ -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" %>
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user