Sha256: 4d0755dd27579132ccd1787f1832b6abac06a1d60b87106c6c67500034c0d155
Contents?: true
Size: 969 Bytes
Versions: 98
Compression:
Stored size: 969 Bytes
Contents
require 'term/ansicolor' module Pact module Provider class PrintMissingProviderStates C = ::Term::ANSIColor # Hash of consumer names to array of names of missing provider states def self.call missing_provider_states, output if missing_provider_states.any? output.puts colorize(text(missing_provider_states)) end end def self.colorize string lines = string.split("\n") first_line = C.cyan(C.underline(lines[0])) other_lines = C.cyan(lines[1..-1].join("\n")) first_line + "\n" + other_lines end def self.text missing_provider_states create_provider_states_for(missing_provider_states) end def self.create_provider_states_for consumers ERB.new(template_string).result(binding) end def self.template_string File.read(File.expand_path( '../../templates/provider_state.erb', __FILE__)) end end end end
Version data entries
98 entries across 98 versions & 1 rubygems