Sha256: 617c7cc5635debcd9ddbd02c7e458e693a20cb223ef1e22f12d3b44f37f80937

Contents?: true

Size: 697 Bytes

Versions: 14

Compression:

Stored size: 697 Bytes

Contents

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 args=`
      end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
spring-1.2.0 lib/spring/client/status.rb
spring-1.1.3 lib/spring/client/status.rb
spring-1.1.2 lib/spring/client/status.rb
spring-1.1.1 lib/spring/client/status.rb
spring-1.1.0 lib/spring/client/status.rb
spring-1.1.0.beta4 lib/spring/client/status.rb
spring-1.1.0.beta3 lib/spring/client/status.rb
spring-1.1.0.beta2 lib/spring/client/status.rb
spring-1.1.0.beta1 lib/spring/client/status.rb
spring-1.0.0 lib/spring/client/status.rb
spring-0.9.2 lib/spring/client/status.rb
spring-0.9.1 lib/spring/client/status.rb
spring-0.9.0 lib/spring/client/status.rb
spring-0.0.11 lib/spring/client/status.rb