class Pact::Provider::Help::Content

Attributes

pact_sources[R]

Public Class Methods

new(pact_sources) click to toggle source
# File lib/pact/provider/help/content.rb, line 8
def initialize pact_sources
  @pact_sources = pact_sources
end

Public Instance Methods

text() click to toggle source
# File lib/pact/provider/help/content.rb, line 12
def text
  help_text + "\n\n" + pact_diffs
end

Private Instance Methods

help_text() click to toggle source
# File lib/pact/provider/help/content.rb, line 20
def help_text
  temp_dir = Pact.configuration.tmp_dir
  log_path = Pact.configuration.log_path
  ERB.new(template_string).result(binding)
end
pact_diffs() click to toggle source
# File lib/pact/provider/help/content.rb, line 30
def pact_diffs
  pact_sources.collect do | pact_json |
    PactDiff.call(pact_json)
  end.compact.join("\n")
end
template_string() click to toggle source
# File lib/pact/provider/help/content.rb, line 26
def template_string
  File.read(File.expand_path( '../../../templates/help.erb', __FILE__))
end