Module: Grably::DSL

Defined in:
lib/grably/core/dsl.rb

Overview

Contains custom Grably DSL definitions.

Instance Method Summary collapse

Instance Method Details

#grab(module_call, as:, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/grably/core/dsl.rb', line 4

def grab(module_call, as:, &block)
  executor = Grably.server.schedule(module_call)

  last_desc = Rake.application.last_description
  desc module_call.pretty_print unless last_desc
  task(as) do |t|
    products = executor.call(t.task_dir)
    block ? yield(t, products) : (t << products)
  end
end