Sha256: 9acfd5e3b614bebb6b1460c6861d919900cf87733bc5f9810d64396ba095de80

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

require 'mattock/cascading-definition'
require 'rake/task'

module Mattock
  class Task < Rake::Task
    include CascadingDefinition

    setting :task_name

    def action
    end

    def task_args
      [task_name]
    end

    def task_class
      return @task_class if @task_class
      @task_class = Class.new(self.class) do
        define_method :initialize, Rake::Task.instance_method(:initialize)
      end
    end

    def inspect
      "Mattock::Task"
    end

    def define
      task  =task_class.define_task(*task_args) do
        action
      end
      copy_settings_to(task)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mattock-0.1.0 lib/mattock/task.rb