Sha256: 5a06c9e73a5cf4bdf482eef1ed2a22fbd42122d883313fae27f2f5654057ce3c
Contents?: true
Size: 603 Bytes
Versions: 18
Compression:
Stored size: 603 Bytes
Contents
module Pact module PactFile extend self def read uri, options = {} pact = open(uri) { | file | file.read } if options[:save_pactfile_to_tmp] save_pactfile_to_tmp pact, ::File.basename(uri) end pact rescue StandardError => e $stderr.puts "Error reading file from #{uri}" $stderr.puts "#{e.to_s} #{e.backtrace.join("\n")}" raise e end def save_pactfile_to_tmp pact, name ::FileUtils.mkdir_p Pact.configuration.tmp_dir ::File.open(Pact.configuration.tmp_dir + "/#{name}", "w") { |file| file << pact} end end end
Version data entries
18 entries across 18 versions & 1 rubygems