Class: Tocer::Rake::Register

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/tocer/rake/register.rb

Overview

Registers Rake tasks for use.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner: Runner.new) ⇒ Register

Returns a new instance of Register.



18
19
20
21
# File 'lib/tocer/rake/register.rb', line 18

def initialize(runner: Runner.new, **)
  @runner = runner
  super(**)
end

Class Method Details

.callObject



16
# File 'lib/tocer/rake/register.rb', line 16

def self.call = new.call

Instance Method Details

#callObject



23
24
25
26
27
28
29
# File 'lib/tocer/rake/register.rb', line 23

def call
  desc "Update/Insert Table of Contents"
  task :toc, %i[label patterns] do |_task, arguments|
    settings.merge! arguments
    runner.call
  end
end