aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/pathname.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 98618be41..bd0e6154e 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -1,8 +1,11 @@
require 'pathname'
require 'bottles'
+require 'mach'
# we enhance pathname to make our code more readable
class Pathname
+ include MachO
+
def install *sources
results = []
sources.each do |src|
@@ -268,6 +271,10 @@ class Pathname
end
end
+ def text_executable?
+ %r[#!\s*(/.+)+] === open('r') { |f| f.readline }
+ end
+
def incremental_hash(hasher)
incr_hash = hasher.new
self.open('r') do |f|