diff options
| author | Mike McQuaid | 2012-03-07 21:30:03 -0500 |
|---|---|---|
| committer | Mike McQuaid | 2012-03-10 18:10:40 +1300 |
| commit | 28b8cc7ee67ed8c1a502e92fde28e5e366cf9139 (patch) | |
| tree | 0632caaa730216f155c2e68fa6f83aa47183358d /Library/Homebrew/extend | |
| parent | 24476086ae82a4f3d783f547aa0a57e82829787d (diff) | |
| download | homebrew-28b8cc7ee67ed8c1a502e92fde28e5e366cf9139.tar.bz2 | |
Move most bottle stuff to a bottles.rb file.
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 59a5087e7..25d19e2e7 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -1,3 +1,5 @@ +require 'bottles' + module HomebrewArgvExtension def named @named ||= reject{|arg| arg[0..0] == '-'} @@ -94,12 +96,12 @@ module HomebrewArgvExtension end def build_bottle? - MacOS.bottles_supported? and include? '--build-bottle' + bottles_supported? and include? '--build-bottle' end def build_from_source? flag? '--build-from-source' or ENV['HOMEBREW_BUILD_FROM_SOURCE'] \ - or not MacOS.bottles_supported? or not options_only.empty? + or not bottles_supported? or not options_only.empty? end def flag? flag diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index f05fc9f5f..34f692f28 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -1,4 +1,5 @@ require 'pathname' +require 'bottles' # we enhance pathname to make our code more readable class Pathname @@ -100,9 +101,9 @@ class Pathname # extended to support common double extensions def extname - return $1 if to_s =~ /(\.[a-z]+\.bottle\.tar\.gz)$/ + return $1 if to_s =~ bottle_regex # old brew bottle style - return $1 if to_s =~ /(-bottle\.tar\.gz)$/ + return $1 if to_s =~ old_bottle_regex /(\.(tar|cpio)\.(gz|bz2|xz|Z))$/.match to_s return $1 if $1 return File.extname(to_s) |
