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



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

def error
  @error
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)


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

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

#messagesObject



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

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)


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

def ran?
  skipped.nil?
end