Skip to content

Commit 2405f6c

Browse files
committed
Lazy-load tempfile
Since tempfile requires tmpdir which requires fileutils, which is a gem on 2.5
1 parent 687337a commit 2405f6c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/thor/shell/basic.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require "tempfile"
2-
31
class Thor
42
module Shell
53
class Basic
@@ -349,6 +347,7 @@ def file_collision_help #:nodoc:
349347
def show_diff(destination, content) #:nodoc:
350348
diff_cmd = ENV["THOR_DIFF"] || ENV["RAILS_DIFF"] || "diff -u"
351349

350+
require "tempfile"
352351
Tempfile.open(File.basename(destination), File.dirname(destination)) do |temp|
353352
temp.write content
354353
temp.rewind

0 commit comments

Comments
 (0)