Sha256: 04e4324f83dc5f1cd280bd26b0617b24e50efad6ec166c2b9e99d08ea970389d
Contents?: true
Size: 893 Bytes
Versions: 18
Compression:
Stored size: 893 Bytes
Contents
# frozen_string_literal: true module Nonnative class GoCommand def initialize(exec, output) @exec = exec @output = output end def executable(cmd, *params) params = params.join(' ') "#{exec} #{flags(cmd, params).join(' ')} #{cmd} #{params}".strip end private attr_reader :exec, :output def flags(cmd, params) suffix = SecureRandom.alphanumeric(4) m = File.basename(exec, File.extname(exec)) p = params.gsub(/\W/, '') name = [m, cmd, p].reject(&:empty?).join('-') path = "#{output}/#{name}-#{suffix}" [ "-test.cpuprofile=#{path}-cpu.prof", "-test.memprofile=#{path}-mem.prof", "-test.blockprofile=#{path}-block.prof", "-test.mutexprofile=#{path}-mutex.prof", "-test.coverprofile=#{path}.cov", "-test.trace=#{path}-trace.out" ] end end end
Version data entries
18 entries across 18 versions & 1 rubygems