Class: Pact::Message::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/pact/message/cli.rb

Instance Method Summary collapse

Instance Method Details

#reify(json) ⇒ Object



22
23
24
25
# File 'lib/pact/message/cli.rb', line 22

def reify(json)
  require 'pact/support'
  puts Pact::Reification.from_term(JSON.load(json)).to_json
end

#update(message) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/pact/message/cli.rb', line 13

def update(message)
  require 'pact/message'
  require 'pact/message/consumer/update_pact'
  pact_specification_version = Pact::SpecificationVersion.new(options.pact_specification_version)
  message = Pact::Message.from_hash(JSON.load(message), { pact_specification_version: pact_specification_version })
  Pact::Message::Consumer::UpdatePact.call(message, options.pact_dir, options.consumer, options.provider, options.pact_specification_version)
end

#versionObject



28
29
30
31
# File 'lib/pact/message/cli.rb', line 28

def version
  require 'pact/message/version.rb'
  puts Pact::Message::VERSION
end