aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorJack Nagel2014-04-20 19:54:32 -0500
committerJack Nagel2014-04-20 19:59:25 -0500
commit7498cfff996c3eacdff0637614aaf59965b02cdf (patch)
treeaf0f455f6afbfe63863748965ddcf1f11ea18be3 /Library/ENV
parentd1041319f401d1a3a559d551d7b6a89bc3f4ee0b (diff)
downloadbrew-7498cfff996c3eacdff0637614aaf59965b02cdf.tar.bz2
Remove to_flags monkeypatch
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/cc8
-rw-r--r--Library/ENV/libsuperenv.rb6
2 files changed, 6 insertions, 8 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index d05e81074..9c1eeb23e 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -232,7 +232,7 @@ class Cmd
syslibpath
end
def ldflags
- args = libpath.to_flags('-L')
+ args = path_flags("-L", libpath)
case mode
when :ld then args << '-headerpad_max_install_names'
when :ccld then args << '-Wl,-headerpad_max_install_names'
@@ -247,7 +247,7 @@ class Cmd
sys, opt = cpath
# we want our keg-only includes to be found before system includes *and*
# before any other includes the build-system adds
- sys.to_flags('-isystem') + opt.to_flags('-I')
+ path_flags("-isystem", sys) + path_flags("-I", opt)
end
def make_fuss args
return unless make_fuss?
@@ -278,6 +278,10 @@ class Cmd
path = path.realpath if path.exist?
path.to_s
end
+ def path_flags(prefix, paths)
+ paths = paths.uniq.select { |path| File.directory?(path) }
+ paths.map! { |path| prefix + path }
+ end
end
if __FILE__ == $PROGRAM_NAME
diff --git a/Library/ENV/libsuperenv.rb b/Library/ENV/libsuperenv.rb
index c6b8c1c4b..1b4ffa19d 100644
--- a/Library/ENV/libsuperenv.rb
+++ b/Library/ENV/libsuperenv.rb
@@ -13,9 +13,3 @@ class NilClass
def chuzzle; end
def split(x); [] end
end
-
-class Array
- def to_flags prefix
- select { |path| File.directory? path }.uniq.map { |path| prefix + path }
- end
-end