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'
|
require 'fileutils'
|
||||||
|
|
||||||
# We enhance FileUtils to make our Formula code more readable.
|
# We enhance FileUtils to make our Formula code more readable.
|
||||||
module Homebrew::FileUtils
|
module FileUtils extend self
|
||||||
include FileUtils
|
|
||||||
|
|
||||||
# Create a temporary directory then yield. When the block returns,
|
# Create a temporary directory then yield. When the block returns,
|
||||||
# recursively delete the temporary directory.
|
# 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.
|
# A version of mkdir that also changes to that folder in a block.
|
||||||
def mkdir name, &block
|
def mkdir name, &block
|
||||||
super(name)
|
FileUtils.mkdir(name)
|
||||||
if block_given?
|
if block_given?
|
||||||
chdir name do
|
chdir name do
|
||||||
yield
|
yield
|
||||||
|
|||||||
@ -6,7 +6,7 @@ require 'extend/fileutils'
|
|||||||
|
|
||||||
# Derive and define at least @url, see Library/Formula for examples
|
# Derive and define at least @url, see Library/Formula for examples
|
||||||
class Formula
|
class Formula
|
||||||
include Homebrew::FileUtils
|
include FileUtils
|
||||||
|
|
||||||
attr_reader :name, :path, :url, :version, :homepage, :specs, :downloader
|
attr_reader :name, :path, :url, :version, :homepage, :specs, :downloader
|
||||||
attr_reader :standard, :unstable
|
attr_reader :standard, :unstable
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user