Remove nil split monkeypatch
This commit is contained in:
parent
bef9ec29ef
commit
a379fc7f79
@ -217,15 +217,17 @@ class Cmd
|
|||||||
syspath.map{|d| "#{d}/lib" }.reject{|d| d == "#{brewfix}/lib" }
|
syspath.map{|d| "#{d}/lib" }.reject{|d| d == "#{brewfix}/lib" }
|
||||||
end
|
end
|
||||||
def cpath
|
def cpath
|
||||||
cpath = ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/include" } + ENV['CMAKE_INCLUDE_PATH'].split(':')
|
cpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "include") }
|
||||||
|
cpath += path_split("CMAKE_INCLUDE_PATH")
|
||||||
opt = cpath.grep(%r{^#{Regexp.escape(brewfix)}/opt})
|
opt = cpath.grep(%r{^#{Regexp.escape(brewfix)}/opt})
|
||||||
sys = cpath - opt
|
sys = cpath - opt
|
||||||
[sys, opt]
|
[sys, opt]
|
||||||
end
|
end
|
||||||
def libpath
|
def libpath
|
||||||
ENV['CMAKE_PREFIX_PATH'].split(':').map{|d| "#{d}/lib" } +
|
libpath = path_split("CMAKE_PREFIX_PATH").map! { |d| File.join(d, "lib") }
|
||||||
ENV['CMAKE_LIBRARY_PATH'].split(':') -
|
libpath += path_split("CMAKE_LIBRARY_PATH")
|
||||||
syslibpath
|
libpath -= syslibpath
|
||||||
|
libpath
|
||||||
end
|
end
|
||||||
def ldflags
|
def ldflags
|
||||||
args = path_flags("-L", libpath)
|
args = path_flags("-L", libpath)
|
||||||
@ -278,6 +280,9 @@ class Cmd
|
|||||||
paths = paths.uniq.select { |path| File.directory?(path) }
|
paths = paths.uniq.select { |path| File.directory?(path) }
|
||||||
paths.map! { |path| prefix + path }
|
paths.map! { |path| prefix + path }
|
||||||
end
|
end
|
||||||
|
def path_split(key)
|
||||||
|
ENV.fetch(key) { "" }.split(File::PATH_SEPARATOR)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if __FILE__ == $PROGRAM_NAME
|
if __FILE__ == $PROGRAM_NAME
|
||||||
|
|||||||
@ -11,5 +11,4 @@ end
|
|||||||
|
|
||||||
class NilClass
|
class NilClass
|
||||||
def chuzzle; end
|
def chuzzle; end
|
||||||
def split(x); [] end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user