HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/rubygems-integration/all/gems/spring-2.1.1/lib/spring/client/status.rb
module Spring
  module Client
    class Status < Command
      def self.description
        "Show current status."
      end

      def call
        if env.server_running?
          puts "Spring is running:"
          puts
          print_process env.pid
          application_pids.each { |pid| print_process pid }
        else
          puts "Spring is not running."
        end
      end

      def print_process(pid)
        puts `ps -p #{pid} -o pid= -o command=`
      end

      def application_pids
        candidates = `ps -ax -o ppid= -o pid=`.lines
        candidates.select { |l| l =~ /^(\s+)?#{env.pid} / }
                  .map    { |l| l.split(" ").last   }
      end
    end
  end
end