File: service.rb

package info (click to toggle)
ruby-specinfra 2.94.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,464 kB
  • sloc: ruby: 10,562; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 563 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Specinfra::Command::Darwin::Base::Service < Specinfra::Command::Base::Service
  class << self
    def check_is_enabled(service, level=nil)
      "launchctl list | grep #{escape(service)}"
    end

    def check_is_enabled_under_homebrew(service)
      "brew services list | grep #{escape(service)}"
    end

    def check_is_running(service)
      "launchctl list | grep #{escape(service)} | grep -E '^[0-9]+'"
    end

    def check_is_running_under_homebrew(service)
      "brew services list | grep #{escape(service)} | grep 'started'"
    end
  end
end