lib/appmap/util.rb in appmap-0.64.0 vs lib/appmap/util.rb in appmap-0.65.0
- old
+ new
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require 'bundler'
+require 'fileutils'
module AppMap
module Util
# https://wynnnetherland.com/journal/a-stylesheet-author-s-guide-to-terminal-colors/
# Embed in a String to clear all previous ANSI sequences.
@@ -128,10 +129,9 @@
end.join('/')
end
# Atomically writes AppMap data to +filename+.
def write_appmap(filename, appmap)
- require 'fileutils'
require 'tmpdir'
# This is what Ruby Tempfile does; but we don't want the file to be unlinked.
mode = File::RDWR | File::CREAT | File::EXCL
::Dir::Tmpname.create([ 'appmap_', '.json' ]) do |tmpname|