class Pact::Provider::PrintMissingProviderStates
Public Class Methods
Source
# File lib/pact/provider/print_missing_provider_states.rb, line 8 def self.call missing_provider_states, output if missing_provider_states.any? output.puts colorize(text(missing_provider_states)) end end
Hash of consumer names to array of names of missing provider states
Source
# File lib/pact/provider/print_missing_provider_states.rb, line 14 def self.colorize string lines = string.split("\n") first_line = Rainbow(lines[0]).cyan.underline other_lines = Rainbow(lines[1..-1].join("\n")).cyan first_line + "\n" + other_lines end
Source
# File lib/pact/provider/print_missing_provider_states.rb, line 25 def self.create_provider_states_for consumers ERB.new(template_string).result(binding) end
Source
# File lib/pact/provider/print_missing_provider_states.rb, line 29 def self.template_string File.read(File.expand_path( '../../templates/provider_state.erb', __FILE__)) end
Source
# File lib/pact/provider/print_missing_provider_states.rb, line 21 def self.text missing_provider_states create_provider_states_for(missing_provider_states) end