From 72bde8c583f51d746b138161c6e84bde98d13c83 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 21 Aug 2009 20:30:13 +0100 Subject: [PATCH] Move download strategies into their own file --- Library/Homebrew/brewkit.rb | 1 + Library/Homebrew/download_strategy.rb | 109 ++++++++++++++++++++++++++ Library/Homebrew/formula.rb | 102 +----------------------- Library/Homebrew/unittest.rb | 1 + 4 files changed, 114 insertions(+), 99 deletions(-) create mode 100644 Library/Homebrew/download_strategy.rb diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb index c8702c4b16..8af00b5afd 100644 --- a/Library/Homebrew/brewkit.rb +++ b/Library/Homebrew/brewkit.rb @@ -17,6 +17,7 @@ # require 'osx/cocoa' # to get number of cores require 'formula' +require 'download_strategy' require 'hw.model' ENV['MACOSX_DEPLOYMENT_TARGET']='10.5' diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb new file mode 100644 index 0000000000..14c22468c9 --- /dev/null +++ b/Library/Homebrew/download_strategy.rb @@ -0,0 +1,109 @@ +# Copyright 2009 Max Howell +# +# This file is part of Homebrew. +# +# Homebrew is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Homebrew is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Homebrew. If not, see . +# +class AbstractDownloadStrategy + def initialize url, name, version + @url=url + @unique_token="#{name}-#{version}" + end +end + +class HttpDownloadStrategy . - - -class AbstractDownloadStrategy - def initialize url, name, version - @url=url - @unique_token="#{name}-#{version}" - end -end - -class HttpDownloadStrategy