Class: TsykvasRailsTemplate::Probe

Inherits:
Object
  • Object
show all
Defined in:
lib/tsykvas_rails_template/probe.rb

Overview

Deterministic project inventory for ‘/tsykvas-claude`.

Reads files from a Rails app root and returns a structured Hash that the slash command can consume verbatim — keeps the LLM out of the inventory step so what’s “true about the project” is testable and stable run-to-run.

Constant Summary collapse

SCHEMA_VERSION =
2

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Probe

Returns a new instance of Probe.



19
20
21
# File 'lib/tsykvas_rails_template/probe.rb', line 19

def initialize(root)
  @root = Pathname(root)
end

Class Method Details

.run(root: Dir.pwd) ⇒ Object



15
16
17
# File 'lib/tsykvas_rails_template/probe.rb', line 15

def self.run(root: Dir.pwd)
  new(root).run
end

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/tsykvas_rails_template/probe.rb', line 23

def run
  {
    schema_version: SCHEMA_VERSION,
    gem_version: TsykvasRailsTemplate::VERSION,
    root: root.to_s,
    ruby_version: detect_ruby_version,
    rails_version: detect_rails_version,
    default_branch: detect_default_branch,
    api_only: detect_api_only,
    engine_host: detect_engine_host,
    template_engine: detect_template_engine,
    auth: detect_auth,
    authorization: detect_authorization,
    has_api_v1: detect_api_v1,
    has_bootstrap: detect_bootstrap,
    test_framework: detect_test_framework,
    background_jobs: detect_background_jobs,
    databases: detect_databases,
    concept_folders: detect_concept_folders,
    application_controller_includes: detect_application_controller_includes
  }
end