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

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



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

def error
  @error
end

#installedObject

Returns the value of attribute installed

Returns:

  • (Object)

    the current value of installed



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

def installed
  @installed
end

#orphanedObject

Returns the value of attribute orphaned

Returns:

  • (Object)

    the current value of orphaned



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

def orphaned
  @orphaned
end

#outdatedObject

Returns the value of attribute outdated

Returns:

  • (Object)

    the current value of outdated



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

def outdated
  @outdated
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



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

def skipped
  @skipped
end

#unwiredObject

Returns the value of attribute unwired

Returns:

  • (Object)

    the current value of unwired



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

def unwired
  @unwired
end

Instance Method Details

#installed_anything?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rails/hyperdrive/auto_install.rb', line 20

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

#messagesObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/rails/hyperdrive/auto_install.rb', line 24

def messages
  return [] unless ran?
  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
  lines
end

#ran?Boolean

Returns:

  • (Boolean)


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

def ran?
  skipped.nil?
end