Sha256: 445eaca46bd59e123c92d1462bd0c7f53757cd15262bba4b979d053dc21ecd93

Contents?: true

Size: 512 Bytes

Versions: 8

Compression:

Stored size: 512 Bytes

Contents

module Pact
  module FileName
    extend self

    def file_name consumer_name, provider_name, options = {}
      pid = options[:unique] ? "-#{Process.pid}" : ''
      "#{filenamify(consumer_name)}-#{filenamify(provider_name)}#{pid}.json"
    end

    def file_path consumer_name, provider_name, pact_dir = Pact.configuration.pact_dir, options = {}
      File.join(pact_dir, file_name(consumer_name, provider_name, options))
    end

    def filenamify name
      name.downcase.gsub(/\s/, '_')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pact-support-1.2.99.alpha.1 lib/pact/consumer_contract/file_name.rb
pact-support-1.3.0.alpha.2 lib/pact/consumer_contract/file_name.rb
pact-support-1.3.0.alpha.1 lib/pact/consumer_contract/file_name.rb
pact-support-1.2.4 lib/pact/consumer_contract/file_name.rb
pact-support-1.2.3 lib/pact/consumer_contract/file_name.rb
pact-support-1.2.2 lib/pact/consumer_contract/file_name.rb
pact-support-1.2.1 lib/pact/consumer_contract/file_name.rb
pact-support-1.2.0 lib/pact/consumer_contract/file_name.rb