Extend FileUtils rather than include it

Fixes Homebrew/homebrew#10729.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-03-06 19:23:51 -06:00
parent 158efd8c9a
commit 67c3f1b2b4
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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