diff options
| author | Bob W. Hogg | 2016-09-18 12:11:30 -0400 |
|---|---|---|
| committer | Bob W. Hogg | 2016-09-22 08:31:50 -0400 |
| commit | 0a4bc8494dddad1d843c51d4707a0d290b2a148d (patch) | |
| tree | b1125c23e2c9fa05b76655cdec0b7df3d2a77903 /Library | |
| parent | 54a086e2fe06218c8a336fb7033da60078db7d78 (diff) | |
| download | brew-0a4bc8494dddad1d843c51d4707a0d290b2a148d.tar.bz2 | |
switch to using extend pattern
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/dependency_collector.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/linux/ant_dep.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/extend/os/mac/ant_dep.rb | 5 |
3 files changed, 15 insertions, 6 deletions
diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index ed9fc3a85..20bf39d83 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -5,6 +5,12 @@ require "requirement" require "requirements" require "set" +if OS.mac? + require "extend/os/mac/ant_dep" +elsif OS.linux? + require "extend/os/linux/ant_dep" +end + ## A dependency is a formula that another formula needs to install. ## A requirement is something other than a formula that another formula ## needs to be present. This includes external language modules, @@ -135,12 +141,6 @@ class DependencyCollector end end - def ant_dep(spec, tags) - if MacOS.version >= :mavericks || !OS.mac? - Dependency.new(spec.to_s, tags) - end - end - def resource_dep(spec, tags) tags << :build strategy = spec.download_strategy diff --git a/Library/Homebrew/extend/os/linux/ant_dep.rb b/Library/Homebrew/extend/os/linux/ant_dep.rb new file mode 100644 index 000000000..adc85ebb0 --- /dev/null +++ b/Library/Homebrew/extend/os/linux/ant_dep.rb @@ -0,0 +1,4 @@ +def ant_dep(spec, tags) + # Always use brewed ant on Linux + Dependency.new(spec.to_s, tags) +end diff --git a/Library/Homebrew/extend/os/mac/ant_dep.rb b/Library/Homebrew/extend/os/mac/ant_dep.rb new file mode 100644 index 000000000..397eb0e72 --- /dev/null +++ b/Library/Homebrew/extend/os/mac/ant_dep.rb @@ -0,0 +1,5 @@ +def ant_dep(spec, tags) + if MacOS.version >= :mavericks + Dependency.new(spec.to_s, tags) + end +end |
