Class: RailsTracepointStack::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rails_tracepoint_stack/install/install_generator.rb

Overview

Thin wrapper over SkillInstaller so the behaviour stays testable without booting Rails.

Instance Method Summary collapse

Instance Method Details

#install_agent_skillObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/rails_tracepoint_stack/install/install_generator.rb', line 12

def install_agent_skill
  installer = RailsTracepointStack::SkillInstaller.new(
    destination: destination_root,
    force: options[:force]
  )
  written = installer.install

  if written
    say_status :create, relative_to_original_destination_root(written), :green
  else
    say_status :skip,
      "#{relative_to_original_destination_root(installer.target_path)} already exists (--force to replace)",
      :yellow
  end
end