Class: RailsCTO::Installer

Inherits:
Object
  • Object
show all
Includes:
Reporter
Defined in:
lib/rails_cto/installer.rb

Defined Under Namespace

Classes: Report

Constant Summary collapse

TEMPLATES =
{
  "rubocop.yml" => ".rubocop.yml",
  "reek.yml" => ".reek.yml",
  "bundler-audit.yml" => ".bundler-audit.yml",
  "brakeman.yml" => "config/brakeman.yml",
  "herb/rewriters/align-attributes.mjs" => ".herb/rewriters/align-attributes.mjs",
  "herb/rules/no-inline-styles.mjs" => ".herb/rules/no-inline-styles.mjs"
}.freeze
CLAUDE_START_MARKER =
"<!-- rails-cto:start -->"
CLAUDE_END_MARKER =
"<!-- rails-cto:end -->"

Instance Method Summary collapse

Constructor Details

#initialize(root, force: false, shell: nil) ⇒ Installer

Returns a new instance of Installer.



33
34
35
36
37
38
# File 'lib/rails_cto/installer.rb', line 33

def initialize(root, force: false, shell: nil)
  @root   = root
  @force  = force
  @shell  = shell || Thor::Shell::Basic.new
  @report = Report.empty
end

Instance Method Details

#runObject



40
41
42
43
44
45
46
# File 'lib/rails_cto/installer.rb', line 40

def run
  copy_templates
  patch_test_helper
  patch_claude_md
  render_report
  @report.ok?
end