File: exec.rb

package info (click to toggle)
ruby-excon 0.112.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: ruby: 7,855; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Excon
  module Test
    module Plugin
      module Server
        module Exec
          def start(app_str = app)
            open_process(app_str)
            process_stderr = ""
            line = ''
            until line =~ /\Aready\Z/
              line = error.gets
              raise process_stderr if line.nil?
              process_stderr << line
              fatal_time = elapsed_time > timeout
              if fatal_time
                msg = "executable #{app_str} has taken too long to start"
                raise msg
              end
            end
            true
          end
        end
      end
    end
  end
end