Extend FileUtils rather than include it
Fixes Homebrew/homebrew#10729. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
158efd8c9a
commit
67c3f1b2b4
@ -1,8 +1,7 @@
|
||||
require 'fileutils'
|
||||
|
||||
# We enhance FileUtils to make our Formula code more readable.
|
||||
module Homebrew::FileUtils
|
||||
include FileUtils
|
||||
module FileUtils extend self
|
||||
|
||||
# Create a temporary directory then yield. When the block returns,
|
||||
# recursively delete the temporary directory.
|
||||
@ -29,7 +28,7 @@ module Homebrew::FileUtils
|
||||
|
||||
# A version of mkdir that also changes to that folder in a block.
|
||||
def mkdir name, &block
|
||||
super(name)
|
||||
FileUtils.mkdir(name)
|
||||
if block_given?
|
||||
chdir name do
|
||||
yield
|
||||
|
||||
@ -6,7 +6,7 @@ require 'extend/fileutils'
|
||||
|
||||
# Derive and define at least @url, see Library/Formula for examples
|
||||
class Formula
|
||||
include Homebrew::FileUtils
|
||||
include FileUtils
|
||||
|
||||
attr_reader :name, :path, :url, :version, :homepage, :specs, :downloader
|
||||
attr_reader :standard, :unstable
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user