diff options
| author | Mike McQuaid | 2012-03-07 21:30:03 -0500 |
|---|---|---|
| committer | Mike McQuaid | 2012-03-10 18:10:40 +1300 |
| commit | 552dcdc7035d7114d47751d93630e37ae6d5bf24 (patch) | |
| tree | 3ba45e367fc79d77fee16b9919a44ca56f712d6f /Library/Homebrew/extend | |
| parent | 4a306f32f468a0dfb1cd0faad861b3773babfa33 (diff) | |
| download | brew-552dcdc7035d7114d47751d93630e37ae6d5bf24.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) |
