playwright-ruby-client 1.37.1 → 1.37.2.alpha1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00d50bbadac84d3bfa4881ee450991e7e0999c9ca5daab2343bceb885d90522b
4
- data.tar.gz: 16bfdd05cc45587c02a89a9e9098c32a518c3e6b81e254524393e71b47483391
3
+ metadata.gz: 2f3dd31dc571aeb613bd7b0c1982bfaf800e32298a1a09c6bf3f22f143313301
4
+ data.tar.gz: ca5257a45da152aa89479453e6c05bec7c811490d1ef2f6bcff9fa0073acd08d
5
5
  SHA512:
6
- metadata.gz: 4e936a99c032fb86e7865cc8880c6679a23b2d621624a98b31d528a7c9d9886851b02b6cb9bab43937bf85b85a2d27ee2cbb0d15d25a11f2962066991531eac0
7
- data.tar.gz: 5e3c6c5bf4af0df7129d6c5ed1ebd6b29928ed68b10b698eb3385ac414c3a04a7ec4a96b964feffa6a65e2f96a7821c3dea8e5b841d186312a66ec1ad53ad825
6
+ metadata.gz: 52c39bdf638f07b371bbcacdb02bd4cb4d31f761cc59ae51d6e9a9c7dca89697e59425e10cc348a89ea358aa3d0329f277c6414fd3dde83f396a520e9e6bfc8a
7
+ data.tar.gz: 7446d401d5c102e4e52519471f2627a1f2efb510b72359b6d08928e3a6cad03f0497323246af88f55b6a9daec9910ba0228bd42d3e6a8a36459a2f274cbdb815
@@ -16,6 +16,9 @@ module Playwright
16
16
  end
17
17
  raise ::Playwright::DriverCrashedError.new
18
18
  end
19
+ @transport.on_driver_closed do
20
+ cleanup
21
+ end
19
22
 
20
23
  @objects = {} # Hash[ guid => ChannelOwner ]
21
24
  @waiting_for_object = {} # Hash[ guid => Promise<ChannelOwner> ]
@@ -18,6 +18,10 @@ module Playwright
18
18
  @on_message = block
19
19
  end
20
20
 
21
+ def on_driver_closed(&block)
22
+ @on_driver_closed = block
23
+ end
24
+
21
25
  def on_driver_crashed(&block)
22
26
  @on_driver_crashed = block
23
27
  end
@@ -83,6 +87,7 @@ module Playwright
83
87
  end
84
88
  rescue IOError
85
89
  # disconnected by remote.
90
+ @on_driver_closed&.call
86
91
  end
87
92
 
88
93
  def handle_stderr
@@ -106,6 +111,7 @@ module Playwright
106
111
  end
107
112
  rescue IOError
108
113
  # disconnected by remote.
114
+ @on_driver_closed&.call
109
115
  end
110
116
 
111
117
  def debug_send_message(message)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.37.1'
5
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.37.0'
4
+ VERSION = '1.37.2.alpha1'
5
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.37.1'
6
6
  end
@@ -15,6 +15,10 @@ module Playwright
15
15
  @on_message = block
16
16
  end
17
17
 
18
+ def on_driver_closed(&block)
19
+ @on_driver_closed = block
20
+ end
21
+
18
22
  def on_driver_crashed(&block)
19
23
  @on_driver_crashed = block
20
24
  end
@@ -76,6 +80,10 @@ module Playwright
76
80
 
77
81
  ws.start
78
82
  @ws = promise.value!
83
+ @ws.on_close do |reason, code|
84
+ puts "[WebSocketTransport] closed with code: #{code}, reason: #{reason}"
85
+ @on_driver_closed&.call(reason, code)
86
+ end
79
87
  @ws.on_error do |error|
80
88
  puts "[WebSocketTransport] error: #{error}"
81
89
  @on_driver_crashed&.call
@@ -47,13 +47,13 @@ module Playwright
47
47
  end
48
48
 
49
49
  # @nodoc
50
- def page=(req)
51
- wrap_impl(@impl.page=(unwrap_impl(req)))
50
+ def context=(req)
51
+ wrap_impl(@impl.context=(unwrap_impl(req)))
52
52
  end
53
53
 
54
54
  # @nodoc
55
- def context=(req)
56
- wrap_impl(@impl.context=(unwrap_impl(req)))
55
+ def page=(req)
56
+ wrap_impl(@impl.page=(unwrap_impl(req)))
57
57
  end
58
58
 
59
59
  # -- inherited from EventEmitter --
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.37.1
4
+ version: 1.37.2.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-16 00:00:00.000000000 Z
11
+ date: 2024-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -394,12 +394,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
394
394
  version: '2.4'
395
395
  required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  requirements:
397
- - - ">="
397
+ - - ">"
398
398
  - !ruby/object:Gem::Version
399
- version: '0'
399
+ version: 1.3.1
400
400
  requirements: []
401
401
  rubygems_version: 3.3.26
402
402
  signing_key:
403
403
  specification_version: 4
404
- summary: The Ruby binding of playwright driver 1.37.0
404
+ summary: The Ruby binding of playwright driver 1.37.1
405
405
  test_files: []