Remove some monkeypatches
This commit is contained in:
parent
8c613e618b
commit
a40a0e1862
@ -40,7 +40,7 @@ end
|
||||
|
||||
class Cmd
|
||||
def initialize path, args
|
||||
@arg0 = path.basename.freeze
|
||||
@arg0 = File.basename(path).freeze
|
||||
@args = args.freeze
|
||||
end
|
||||
def mode
|
||||
|
||||
@ -4,19 +4,21 @@
|
||||
# But many build-systems expect it to work. This fixes that.
|
||||
# NOTE only works if the build-tool calls xcrun without a path prefixed!
|
||||
|
||||
require "#{File.dirname __FILE__}/../libsuperenv"
|
||||
SUPERBIN = __FILE__.dirname.cleanpath.freeze
|
||||
dirname = File.dirname(__FILE__)
|
||||
require "#{dirname}/../libsuperenv"
|
||||
SUPERBIN = dirname.cleanpath.freeze
|
||||
|
||||
# Some build tools are stupid and still set DEVELOPER_DIR to old /Developer
|
||||
ENV['DEVELOPER_DIR'] = ENV['HOMEBREW_DEVELOPER_DIR']
|
||||
|
||||
exec "/usr/bin/xcrun", *ARGV if ARGV.empty? or ARGV[0][0..0] == '-'
|
||||
if File.exist?("/usr/bin/#{ARGV.first}")
|
||||
exec "/usr/bin/#{ARGV.shift}", *ARGV unless ENV['HOMEBREW_SDKROOT'].directory?
|
||||
sdkroot = ENV['HOMEBREW_SDKROOT']
|
||||
exec "/usr/bin/#{ARGV.shift}", *ARGV unless sdkroot and File.directory? sdkroot
|
||||
end
|
||||
|
||||
def try path
|
||||
exec path, *ARGV if File.executable?(path) and path.cleanpath.dirname != SUPERBIN
|
||||
exec path, *ARGV if File.executable?(path) and File.dirname(path.cleanpath) != SUPERBIN
|
||||
end
|
||||
|
||||
arg0 = ARGV.shift
|
||||
|
||||
@ -6,22 +6,18 @@
|
||||
$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
|
||||
|
||||
class String
|
||||
def directory?; File.directory? self end
|
||||
def basename; File.basename self end
|
||||
def cleanpath; require 'pathname'; Pathname.new(self).realpath.to_s rescue self end
|
||||
def chuzzle; s = chomp; s unless s.empty? end
|
||||
def dirname; File.dirname(self) end
|
||||
end
|
||||
|
||||
class NilClass
|
||||
def chuzzle; end
|
||||
def directory?; false end
|
||||
def split(x); [] end
|
||||
end
|
||||
|
||||
class Array
|
||||
def to_flags prefix
|
||||
select{|path| path.directory? }.uniq.map{|path| prefix+path }
|
||||
select { |path| File.directory? path }.uniq.map { |path| prefix + path }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user