class Pact::Message::CLI

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/pact/message/cli.rb, line 44
def self.exit_on_failure?
  true
end

Public Instance Methods

reify(json) click to toggle source
# File lib/pact/message/cli.rb, line 32
def reify(json)
  require 'pact/support'
  puts Pact::Reification.from_term(JSON.load(json)).to_json
end
update(maybe_json = '-') click to toggle source
# File lib/pact/message/cli.rb, line 20
def update(maybe_json = '-')
  require 'pact/message'
  require 'pact/message/consumer/write_pact'

  message_object = JSON.load(maybe_json == '-' ? $stdin.read : maybe_json)

  pact_specification_version = Pact::SpecificationVersion.new(options.pact_specification_version)
  message_hash = Pact::Message.from_hash(message_object, { pact_specification_version: pact_specification_version })
  Pact::Message::Consumer::WritePact.call(message_hash, options.pact_dir, options.consumer, options.provider, options.pact_specification_version, :update)
end
version() click to toggle source
# File lib/pact/message/cli.rb, line 38
def version
  require 'pact/message/version.rb'
  puts Pact::Message::VERSION
end