Sha256: 6b326b3b2586f57468c4e86dec5a8b106d859f3af69b50aae970d656a5ba5a99

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 KB

Contents

require 'avrolution/rake/base_task'

module Avrolution
  module Rake
    class AddCompatibilityBreakTask < BaseTask

      def initialize(*)
        super
        @name ||= :add_compatibility_break
        @task_desc ||= 'Add an Avro schema compatibility break. Parameters: name, fingerprint, with_compatibility, after_compatibility'
      end

      private

      def perform
        compatibility_break_args = ENV.to_h.slice('name', 'fingerprint', 'with_compatibility', 'after_compatibility').symbolize_keys

        missing_args = %i(name fingerprint).select do |arg|
          compatibility_break_args[arg].blank?
        end

        if missing_args.any?
          puts missing_args.map { |arg| "#{arg} can't be blank" }.join(', ')
          puts 'Usage: rake avro:add_compatibility_break name=<name> fingerprint=<fingerprint> [with_compatibility=<default:NONE>] [after_compatibility=<compatibility>]'
          exit(1)
        end

        Avrolution::CompatibilityBreaksFile.add(**compatibility_break_args)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
avrolution-0.6.1 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.6.0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.5.0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.5.0.rc0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.4 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.3 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.2 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.1 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.1.rc0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.0.rc1 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.4.0.rc0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.3.0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.2.0 lib/avrolution/rake/add_compatibility_break_task.rb
avrolution-0.1.0 lib/avrolution/rake/add_compatibility_break_task.rb