Class: Sapristi::NewProcessWindowDetector
- Inherits:
-
Object
- Object
- Sapristi::NewProcessWindowDetector
- Defined in:
- lib/sapristi/new_process_window_detector.rb
Instance Method Summary collapse
- #detect_window_for_process(command, timeout_in_seconds = 30) ⇒ Object
-
#initialize ⇒ NewProcessWindowDetector
constructor
A new instance of NewProcessWindowDetector.
Constructor Details
#initialize ⇒ NewProcessWindowDetector
Returns a new instance of NewProcessWindowDetector.
5 6 7 8 |
# File 'lib/sapristi/new_process_window_detector.rb', line 5 def initialize @display = OSFactory.new.window_manager @process_manager = OSFactory.new.process_manager end |
Instance Method Details
#detect_window_for_process(command, timeout_in_seconds = 30) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sapristi/new_process_window_detector.rb', line 10 def detect_window_for_process(command, timeout_in_seconds = 30) save_pids_and_windows process_window = wait_for_window(command, timeout_in_seconds) if process_window ::Sapristi.logger.info " Found window title=#{process_window.title} for process=#{process_window.pid}!" end process_window end |