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(configuration = Container[:configuration], runner: Runner.new) ⇒ Register

Returns a new instance of Register.



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

def initialize configuration = Container[:configuration], runner: Runner.new
  @configuration = configuration
  @runner = runner
end

Class Method Details

.callObject



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

def self.call = new.call

Instance Method Details

#callObject



21
22
23
24
25
26
# File 'lib/tocer/rake/register.rb', line 21

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