Class: Gempilot::ZeitwerkTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/gempilot/zeitwerk_task.rb

Overview

Rake tasks for validating and inspecting a gem's Zeitwerk loader.

Owned by gempilot and consumed by generated gems via require "gempilot/zeitwerk_task"; Gempilot::ZeitwerkTask.new, so the logic rolls forward on a gempilot bump instead of being copied into every gem's Rakefile. Each task boots a clean child process so eager loading surfaces naming errors without polluting the Rake process.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root: Dir.pwd) ⇒ ZeitwerkTask

Returns a new instance of ZeitwerkTask.



15
16
17
18
19
# File 'lib/gempilot/zeitwerk_task.rb', line 15

def initialize(root: Dir.pwd)
  super()
  @project = Project.new(root)
  define_tasks
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



13
14
15
# File 'lib/gempilot/zeitwerk_task.rb', line 13

def project
  @project
end