Class: EnolaRb::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/enola_rb/installer.rb

Defined Under Namespace

Classes: Report

Instance Method Summary collapse

Constructor Details

#initialize(root, binary: nil, stderr: $stderr) ⇒ Installer

Returns a new instance of Installer.



18
19
20
21
22
23
# File 'lib/enola_rb/installer.rb', line 18

def initialize(root, binary: nil, stderr: $stderr)
  @root = File.expand_path(root)
  @binary = binary
  @stderr = stderr
  @report = Report.new(written: [], bound: [], unbound: [], notes: [])
end

Instance Method Details

#installObject

Raises:

  • (Enola::Unavailable)


25
26
27
28
29
30
31
32
33
34
# File 'lib/enola_rb/installer.rb', line 25

def install
  raise Enola::Unavailable, "#{@root} holds no app/ directory; run this from the Rails root" unless File.directory?(File.join(@root, "app"))

  write_config
  copy_starter_laws
  init_with_binary
  comment_unbound
  ignore_artifacts
  @report
end