module Pult::Panel::Provider::Service

Constants

ACTIONS
COMMAND
PATH

Public Class Methods

mixin!(panel) click to toggle source
# File lib/pult/panel/provider/service.rb, line 8
def self.mixin! panel
  hash = pult_hash panel

  Pult::Panel::App.config_dir! hash, Dir.pwd

  panel.merge! hash
end
pult_hash(panel) click to toggle source
# File lib/pult/panel/provider/service.rb, line 16
def self.pult_hash panel
  hash = {}

  for service in services
    hash[service] = {}

    for action in ACTIONS
      hash[service][action] = "#{COMMAND} #{service} #{action}"
    end
  end

  { PATH => hash }
end
services() click to toggle source
# File lib/pult/panel/provider/service.rb, line 30
def self.services
  runner = Pult::Executor.run! "#{COMMAND} --status-all", Dir.pwd

  runner[:stdout].scan(/[a-z][a-z\.0-9-_]+/)
end