Class: ReactOnRails::AgentGuardrails::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/react_on_rails/agent_guardrails.rb

Overview

Encapsulates a single install run against one app root.

Instance Method Summary collapse

Constructor Details

#initialize(destination_root, skip_existing: false) ⇒ Installer

Returns a new instance of Installer.



55
56
57
58
# File 'lib/react_on_rails/agent_guardrails.rb', line 55

def initialize(destination_root, skip_existing: false)
  @destination_root = File.expand_path(destination_root.to_s)
  @skip_existing = skip_existing
end

Instance Method Details

#installObject



60
61
62
63
64
65
66
# File 'lib/react_on_rails/agent_guardrails.rb', line 60

def install
  validate_settings_before_copy
  actions = FILES.map { |source, dest_rel| copy_file(source, dest_rel) }
  actions << register_hook
  actions << remove_legacy_hook
  actions.compact
end