Sha256: 409aaf171dcf62bccdc892eb72e46efda440d22ed7d26f4bc6270e60d9482401

Contents?: true

Size: 520 Bytes

Versions: 13

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

module Unwrappr
  module Writers
    # Delegate to many writers and combine their produced annotations into one.
    #
    # Implements the `annotation_writer` interface required by the
    # LockFileAnnotator.
    class Composite
      def initialize(*writers)
        @writers = writers
      end

      def write(gem_change, gem_change_info)
        @writers.map do |writer|
          writer.write(gem_change, gem_change_info)
        end.compact.join("\n")
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
unwrappr-0.8.2 lib/unwrappr/writers/composite.rb
unwrappr-0.8.1 lib/unwrappr/writers/composite.rb
unwrappr-0.8.0 lib/unwrappr/writers/composite.rb
unwrappr-0.7.0 lib/unwrappr/writers/composite.rb
unwrappr-0.6.0 lib/unwrappr/writers/composite.rb
unwrappr-0.5.0 lib/unwrappr/writers/composite.rb
unwrappr-0.4.0 lib/unwrappr/writers/composite.rb
unwrappr-0.3.5 lib/unwrappr/writers/composite.rb
unwrappr-0.3.4 lib/unwrappr/writers/composite.rb
unwrappr-0.3.3 lib/unwrappr/writers/composite.rb
unwrappr-0.3.2 lib/unwrappr/writers/composite.rb
unwrappr-0.3.1 lib/unwrappr/writers/composite.rb
unwrappr-0.3.0 lib/unwrappr/writers/composite.rb