Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit a2fff2f

Browse files
author
Sam Phippen
committed
Remove dependency on FileUtils.
We now use our own implementation: RSpec::Support::DirectoryMaker instead which implements mkdir_p for us.
1 parent c05587a commit a2fff2f

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

lib/rspec/core/configuration.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require 'fileutils'
2-
31
RSpec::Support.require_rspec_core "backtrace_formatter"
42
RSpec::Support.require_rspec_core "ruby_project"
53
RSpec::Support.require_rspec_core "formatters/deprecation_formatter"

lib/rspec/core/formatters.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
RSpec::Support.require_rspec_support "directory_maker"
12
# ## Built-in Formatters
23
#
34
# * progress (default) - prints dots for passing examples, `F` for failures, `*` for pending
@@ -232,7 +233,7 @@ def underscore(camel_cased_word)
232233
end
233234

234235
def file_at(path)
235-
FileUtils.mkdir_p(File.dirname(path))
236+
RSpec::Support::DirectoryMaker.mkdir_p(File.dirname(path))
236237
File.new(path, 'w')
237238
end
238239
end

lib/rspec/core/project_initializer.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
RSpec::Support.require_rspec_support "directory_maker"
2+
13
module RSpec
24
module Core
35
# @private
@@ -28,7 +30,7 @@ def copy_template(file)
2830
return report_exists(file) if File.exist?(destination_file)
2931

3032
report_creating(file)
31-
FileUtils.mkdir_p(File.dirname(destination_file))
33+
RSpec::Support::DirectoryMaker.mkdir_p(File.dirname(destination_file))
3234
File.open(destination_file, 'w') do |f|
3335
f.write File.read(File.join(template_path, file))
3436
end

spec/support/isolated_directory.rb

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)