Sha256: a3c7186dbd4ce7ff594ce73aab4adf1da0714077cff7bed2ae169ff5e84a3b77
Contents?: true
Size: 1.93 KB
Versions: 1
Compression:
Stored size: 1.93 KB
Contents
require 'pact/configuration' require 'pact/doc/markdown/generator' module Pact module Consumer module Configuration module ConfigurationExtensions DOC_GENERATORS = { markdown: Pact::Doc::Markdown::Generator } def doc_dir @doc_dir ||= File.expand_path("./doc/pacts") end def doc_dir= doc_dir @doc_dir = doc_dir end def reports_dir @reports_dir ||= default_reports_dir end def default_reports_dir File.expand_path("./reports/pacts") end def reports_dir= reports_dir @reports_dir = reports_dir end def add_provider_verification &block provider_verifications << block end def provider_verifications @provider_verifications ||= [] end def doc_generator= doc_generator doc_generators << begin if DOC_GENERATORS[doc_generator] DOC_GENERATORS[doc_generator] elsif doc_generator.respond_to?(:call) doc_generator else raise "Pact.configuration.doc_generator needs to respond to call, or be in the preconfigured list: #{DOC_GENERATORS.keys}" end end end def doc_generators @doc_generators ||= [] end def pactfile_write_mode @pactfile_write_mode ||= :overwrite if @pactfile_write_mode == :smart is_rake_running? ? :overwrite : :update else @pactfile_write_mode end end def pactfile_write_mode= pactfile_write_mode @pactfile_write_mode = pactfile_write_mode end private #Would love a better way of determining this! It sure won't work on windows. def is_rake_running? `ps -ef | grep rake | grep #{Process.ppid} | grep -v 'grep'`.size > 0 end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pact-1.5.0 | lib/pact/consumer/configuration/configuration_extensions.rb |