Class: Rails::Hyperdrive::AutoInstall::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails/hyperdrive/auto_install.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#advisoriesObject

Returns the value of attribute advisories

Returns:

  • (Object)

    the current value of advisories



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def advisories
  @advisories
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def error
  @error
end

#fence_warningsObject

Returns the value of attribute fence_warnings

Returns:

  • (Object)

    the current value of fence_warnings



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def fence_warnings
  @fence_warnings
end

#haltedObject

Returns the value of attribute halted

Returns:

  • (Object)

    the current value of halted



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def halted
  @halted
end

#installedObject

Returns the value of attribute installed

Returns:

  • (Object)

    the current value of installed



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def installed
  @installed
end

#orphanedObject

Returns the value of attribute orphaned

Returns:

  • (Object)

    the current value of orphaned



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def orphaned
  @orphaned
end

#outdatedObject

Returns the value of attribute outdated

Returns:

  • (Object)

    the current value of outdated



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def outdated
  @outdated
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def skipped
  @skipped
end

#unwiredObject

Returns the value of attribute unwired

Returns:

  • (Object)

    the current value of unwired



16
17
18
# File 'lib/rails/hyperdrive/auto_install.rb', line 16

def unwired
  @unwired
end

Instance Method Details

#installed_anything?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rails/hyperdrive/auto_install.rb', line 22

def installed_anything?
  !Array(installed).empty?
end

#messagesObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rails/hyperdrive/auto_install.rb', line 26

def messages
  return [] unless ran?
  return [halted] if halted

  lines = []
  unless Array(installed).empty?
    lines << "installed #{installed.size} artifact(s):"
    installed.each { |path| lines << "  #{path}" }
  end
  lines << "installed guideline(s) are not in context yet — run bin/rails hyperdrive:sync" if unwired
  stale = Array(outdated) + Array(orphaned)
  unless stale.empty?
    lines << "#{stale.size} artifact(s) need attention — run bin/rails hyperdrive:sync"
    stale.each { |entry| lines << "  #{entry}" }
  end
  # An advisory names content that installed but not as the manifest
  # asked; ordinary skips are init/sync's to report, not a bundle
  # install's.
  (Array(advisories) | Array(fence_warnings)).each { |warning| lines << warning }
  lines
end

#ran?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rails/hyperdrive/auto_install.rb', line 18

def ran?
  skipped.nil?
end