Sha256: e1d8fa830855e6aa23e9aee5d6b201a41d9282616e415f634f164a091b697e8c
Contents?: true
Size: 839 Bytes
Versions: 18
Compression:
Stored size: 839 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) m = File.basename(exec, File.extname(exec)) p = params.gsub(/\W/, '') name = [m, cmd, p].reject(&:empty?).join('-') path = "#{output}/#{name}" [ "-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