From 6af1aae50bad076339db6cfe9c6af7898f4d8aea Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 4 Mar 2012 16:52:50 -0800 Subject: [PATCH] Move specialized formulae base classes into a new file --- Library/Homebrew/formula.rb | 16 +--------------- Library/Homebrew/formula_specialties.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 Library/Homebrew/formula_specialties.rb diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 06863c1368..44cf0d3b81 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2,6 +2,7 @@ require 'download_strategy' require 'formula_support' require 'hardware' require 'extend/fileutils' +require 'formula_specialties' # Derive and define at least @url, see Library/Formula for examples @@ -764,18 +765,3 @@ private end end end - -# See youtube-dl.rb for an example -class ScriptFileFormula < Formula - def install - bin.install Dir['*'] - end -end - -# See flac.rb for an example -class GithubGistFormula < ScriptFileFormula - def initialize name='__UNKNOWN__', path=nil - super name, path - @version=File.basename(File.dirname(url))[0,6] - end -end diff --git a/Library/Homebrew/formula_specialties.rb b/Library/Homebrew/formula_specialties.rb new file mode 100644 index 0000000000..6aa4690817 --- /dev/null +++ b/Library/Homebrew/formula_specialties.rb @@ -0,0 +1,16 @@ +# Base classes for specialized types of formulae. + +# See youtube-dl.rb for an example +class ScriptFileFormula < Formula + def install + bin.install Dir['*'] + end +end + +# See flac.rb for an example +class GithubGistFormula < ScriptFileFormula + def initialize name='__UNKNOWN__', path=nil + super name, path + @version=File.basename(File.dirname(url))[0,6] + end +end