Sha256: 6823fb75a4281e7c9f0438fd5d3d2ce502ae343f61608a665caf200cfbe24b4f

Contents?: true

Size: 919 Bytes

Versions: 36

Compression:

Stored size: 919 Bytes

Contents

require 'pact_broker/repositories'

module PactBroker

  module Tags
    module Service

      extend self

      extend PactBroker::Repositories

      def create args
        pacticipant = pacticipant_repository.find_by_name_or_create args.fetch(:pacticipant_name)
        version = version_repository.find_by_pacticipant_id_and_number_or_create pacticipant.id, args.fetch(:pacticipant_version_number)
        tag_repository.create version: version, name: args.fetch(:tag_name)
      end

      def find args
        tag_repository.find args
      end

      def delete args
        version = version_repository.find_by_pacticipant_name_and_number args.fetch(:pacticipant_name), args.fetch(:pacticipant_version_number)
        connection = PactBroker::Domain::Tag.new.db
        connection.run("delete from tags where name = '#{args.fetch(:tag_name)}' and version_id = '#{version.id}'")
      end

    end
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
pact_broker-2.9.0 lib/pact_broker/tags/service.rb
pact_broker-2.9.0.beta.5 lib/pact_broker/tags/service.rb
pact_broker-2.8.0.beta.5 lib/pact_broker/tags/service.rb
pact_broker-2.8.0.beta.4 lib/pact_broker/tags/service.rb
pact_broker-2.7.0.beta.3 lib/pact_broker/tags/service.rb
pact_broker-2.7.0.beta.2 lib/pact_broker/tags/service.rb
pact_broker-2.6.0 lib/pact_broker/tags/service.rb
pact_broker-2.5.1 lib/pact_broker/tags/service.rb
pact_broker-2.5.0 lib/pact_broker/tags/service.rb
pact_broker-2.4.2 lib/pact_broker/tags/service.rb
pact_broker-2.4.1 lib/pact_broker/tags/service.rb
pact_broker-2.4.0 lib/pact_broker/tags/service.rb
pact_broker-2.3.0 lib/pact_broker/tags/service.rb
pact_broker-2.2.0 lib/pact_broker/tags/service.rb
pact_broker-2.1.1 lib/pact_broker/tags/service.rb
pact_broker-2.1.0 lib/pact_broker/tags/service.rb
pact_broker-2.0.5 lib/pact_broker/tags/service.rb
pact_broker-2.0.4 lib/pact_broker/tags/service.rb
pact_broker-2.0.3 lib/pact_broker/tags/service.rb
pact_broker-2.0.2 lib/pact_broker/tags/service.rb