Sha256: 24b6157838439fb91c6af2c703ab2ded02c4e35bc65e6d63cf1edefa8d285057

Contents?: true

Size: 695 Bytes

Versions: 14

Compression:

Stored size: 695 Bytes

Contents

module Avrolution
  module Rake
    class BaseTask < ::Rake::TaskLib

      attr_accessor :name, :task_namespace, :task_desc, :dependencies

      def self.define(**options, &block)
        new(**options, &block).define
      end

      def initialize(name: nil, dependencies: [])
        @name = name
        @task_namespace = :avro
        @dependencies = dependencies

        yield self if block_given?
      end

      def define
        namespace task_namespace do
          desc task_desc
          task(name.to_sym => dependencies) do
            perform
          end
        end
      end

      private

      def perform
        raise NotImplementedError
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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