Class: CheckIt::Services

Inherits:
Object
  • Object
show all
Defined in:
lib/checkit/services.rb

Constant Summary collapse

DEPENDENCY_STATES =
[:ok, :not_running, :not_installed]
EXTERNAL_DEPENDENCIES =
{
  'pg'          => ['postgres'],
  'mysql'       => ['mysqld'],
  'mysql2'      => ['mysqld'],
  'tire'        => ['elasticsearch'],
  'neography'   => ['neo4j'],
  'redis'       => ['redis-server'],
  'amqp'        => ['rabbitmq-server'],
  'sqlite3'     => ['sqlite3'],
  'carrierwave' => ['convert']
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Services

Returns a new instance of Services.



20
21
22
# File 'lib/checkit/services.rb', line 20

def initialize(io)
  self.io = io
end

Instance Attribute Details

#ioObject

Returns the value of attribute io.



4
5
6
# File 'lib/checkit/services.rb', line 4

def io
  @io
end

Instance Method Details

#perform_checksObject



24
25
26
27
28
29
30
31
# File 'lib/checkit/services.rb', line 24

def perform_checks
  dependency_states.each do |name, command_states|
    io.puts " * Gem '#{name}' will need:"
    command_states.each do |cmd, state|
      io.puts "   #{cmd}: #{human_state(state)}"
    end
  end
end