Skip to content

Commit 7a6dba6

Browse files
authored
Explicity require fileutils (#15)
Unsure if it's related to this gem, but sometimes there are `FileUtils` conflicts when using ruby 2.7 or an app which has required a non standard version of `FileUtils`. To ensure to the correct version is always used, I've added an explicit require to the file.
1 parent 9c89e0d commit 7a6dba6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: lib/diffcrypt/rails/encrypted_configuration.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require 'fileutils'
34
require 'pathname'
45
require 'tmpdir'
56

@@ -50,7 +51,7 @@ def write(contents, original_encrypted_contents = nil)
5051
deserialize(contents)
5152

5253
IO.binwrite "#{content_path}.tmp", encrypt(contents, original_encrypted_contents)
53-
FileUtils.mv "#{content_path}.tmp", content_path
54+
::FileUtils.mv "#{content_path}.tmp", content_path
5455
end
5556

5657
def config
@@ -81,7 +82,7 @@ def writing(contents)
8182

8283
write(updated_contents, content_path_diffable? && content_path.binread)
8384
ensure
84-
FileUtils.rm(tmp_path) if tmp_path&.exist?
85+
::FileUtils.rm(tmp_path) if tmp_path&.exist?
8586
end
8687
# rubocop:enable Metrics/AbcSize
8788

0 commit comments

Comments
 (0)