Sha256: b74042a38974954479c3c4837110dda8e02db351848b6584845b9fa8dca12fef

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

require "rake"
require "active_support/core_ext/string"

module OopsARake
  class Registry
    @tasks = {}

    def self.register(task_class)
      task = Rake::Task.define_task(task_class.task_name) do |_, args|
        task_class.new.call(*args)
      end

      @tasks[task_class] = task
      task
    end

    def self.fetch(task_class)
      @tasks.fetch(task_class)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oops_a_rake-0.2.0 lib/oops_a_rake/registry.rb