puppeteer-ruby 0.31.0 → 0.31.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -1
- data/LICENSE +201 -0
- data/README.md +5 -1
- data/docs/api_coverage.md +359 -0
- data/lib/puppeteer.rb +5 -167
- data/lib/puppeteer/connection.rb +39 -1
- data/lib/puppeteer/element_handle.rb +3 -3
- data/lib/puppeteer/env.rb +3 -3
- data/lib/puppeteer/page.rb +17 -7
- data/lib/puppeteer/page/pdf_options.rb +15 -15
- data/lib/puppeteer/puppeteer.rb +164 -0
- data/lib/puppeteer/version.rb +2 -2
- data/lib/puppeteer/wait_task.rb +17 -22
- data/puppeteer-ruby.gemspec +5 -2
- metadata +21 -13
- data/.circleci/config.yml +0 -92
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -17
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -15
- data/.github/stale.yml +0 -16
- data/.github/workflows/docs.yml +0 -45
- data/.github/workflows/reviewdog.yml +0 -18
- data/.github/workflows/windows_check.yml +0 -40
- data/.gitignore +0 -21
- data/.travis.yml +0 -7
data/lib/puppeteer/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION = '0.31.
|
1
|
+
module Puppeteer
|
2
|
+
VERSION = '0.31.6'
|
3
3
|
end
|
data/lib/puppeteer/wait_task.rb
CHANGED
@@ -135,18 +135,17 @@ class Puppeteer::WaitTask
|
|
135
135
|
/**
|
136
136
|
* @return {!Promise<*>}
|
137
137
|
*/
|
138
|
-
function pollMutation() {
|
139
|
-
const success = predicate(...args);
|
140
|
-
if (success)
|
141
|
-
return Promise.resolve(success);
|
138
|
+
async function pollMutation() {
|
139
|
+
const success = await predicate(...args);
|
140
|
+
if (success) return Promise.resolve(success);
|
142
141
|
let fulfill;
|
143
142
|
const result = new Promise((x) => (fulfill = x));
|
144
|
-
const observer = new MutationObserver(() => {
|
143
|
+
const observer = new MutationObserver(async () => {
|
145
144
|
if (timedOut) {
|
146
145
|
observer.disconnect();
|
147
146
|
fulfill();
|
148
147
|
}
|
149
|
-
const success = predicate(...args);
|
148
|
+
const success = await predicate(...args);
|
150
149
|
if (success) {
|
151
150
|
observer.disconnect();
|
152
151
|
fulfill(success);
|
@@ -159,38 +158,34 @@ class Puppeteer::WaitTask
|
|
159
158
|
});
|
160
159
|
return result;
|
161
160
|
}
|
162
|
-
function pollRaf() {
|
161
|
+
async function pollRaf() {
|
163
162
|
let fulfill;
|
164
163
|
const result = new Promise((x) => (fulfill = x));
|
165
|
-
onRaf();
|
164
|
+
await onRaf();
|
166
165
|
return result;
|
167
|
-
function onRaf() {
|
166
|
+
async function onRaf() {
|
168
167
|
if (timedOut) {
|
169
168
|
fulfill();
|
170
169
|
return;
|
171
170
|
}
|
172
|
-
const success = predicate(...args);
|
173
|
-
if (success)
|
174
|
-
|
175
|
-
else
|
176
|
-
requestAnimationFrame(onRaf);
|
171
|
+
const success = await predicate(...args);
|
172
|
+
if (success) fulfill(success);
|
173
|
+
else requestAnimationFrame(onRaf);
|
177
174
|
}
|
178
175
|
}
|
179
|
-
function pollInterval(pollInterval) {
|
176
|
+
async function pollInterval(pollInterval) {
|
180
177
|
let fulfill;
|
181
178
|
const result = new Promise((x) => (fulfill = x));
|
182
|
-
onTimeout();
|
179
|
+
await onTimeout();
|
183
180
|
return result;
|
184
|
-
function onTimeout() {
|
181
|
+
async function onTimeout() {
|
185
182
|
if (timedOut) {
|
186
183
|
fulfill();
|
187
184
|
return;
|
188
185
|
}
|
189
|
-
const success = predicate(...args);
|
190
|
-
if (success)
|
191
|
-
|
192
|
-
else
|
193
|
-
setTimeout(onTimeout, pollInterval);
|
186
|
+
const success = await predicate(...args);
|
187
|
+
if (success) fulfill(success);
|
188
|
+
else setTimeout(onTimeout, pollInterval);
|
194
189
|
}
|
195
190
|
}
|
196
191
|
}
|
data/puppeteer-ruby.gemspec
CHANGED
@@ -12,7 +12,9 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = 'https://github.com/YusukeIwaki/puppeteer-ruby'
|
13
13
|
|
14
14
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
15
|
-
`git ls-files -z`.split("\x0").reject
|
15
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
16
|
+
f.match(%r{^(test|spec|features)/}) || f.include?(".git") || f.include?(".circleci") || f.start_with?("development/")
|
17
|
+
end
|
16
18
|
end
|
17
19
|
spec.bindir = 'exe'
|
18
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
@@ -23,11 +25,12 @@ Gem::Specification.new do |spec|
|
|
23
25
|
spec.add_dependency 'mime-types', '>= 3.0'
|
24
26
|
spec.add_development_dependency 'bundler', '~> 2.2.3'
|
25
27
|
spec.add_development_dependency 'chunky_png'
|
28
|
+
spec.add_development_dependency 'dry-inflector'
|
26
29
|
spec.add_development_dependency 'pry-byebug'
|
27
30
|
spec.add_development_dependency 'rake', '~> 13.0.3'
|
28
31
|
spec.add_development_dependency 'rspec', '~> 3.10.0 '
|
29
32
|
spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
|
30
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
33
|
+
spec.add_development_dependency 'rubocop', '~> 1.12.0'
|
31
34
|
spec.add_development_dependency 'rubocop-rspec'
|
32
35
|
spec.add_development_dependency 'sinatra'
|
33
36
|
spec.add_development_dependency 'webrick'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppeteer-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.31.
|
4
|
+
version: 0.31.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03
|
11
|
+
date: 2021-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: dry-inflector
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: pry-byebug
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +156,14 @@ dependencies:
|
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
159
|
+
version: 1.12.0
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
166
|
+
version: 1.12.0
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: rubocop-rspec
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -213,25 +227,18 @@ executables: []
|
|
213
227
|
extensions: []
|
214
228
|
extra_rdoc_files: []
|
215
229
|
files:
|
216
|
-
- ".circleci/config.yml"
|
217
|
-
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
218
|
-
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
219
|
-
- ".github/stale.yml"
|
220
|
-
- ".github/workflows/docs.yml"
|
221
|
-
- ".github/workflows/reviewdog.yml"
|
222
|
-
- ".github/workflows/windows_check.yml"
|
223
|
-
- ".gitignore"
|
224
230
|
- ".rspec"
|
225
231
|
- ".rubocop.yml"
|
226
|
-
- ".travis.yml"
|
227
232
|
- CHANGELOG.md
|
228
233
|
- Dockerfile
|
229
234
|
- Gemfile
|
235
|
+
- LICENSE
|
230
236
|
- README.md
|
231
237
|
- Rakefile
|
232
238
|
- bin/console
|
233
239
|
- bin/setup
|
234
240
|
- docker-compose.yml
|
241
|
+
- docs/api_coverage.md
|
235
242
|
- lib/puppeteer.rb
|
236
243
|
- lib/puppeteer/aria_query_handler.rb
|
237
244
|
- lib/puppeteer/browser.rb
|
@@ -283,6 +290,7 @@ files:
|
|
283
290
|
- lib/puppeteer/page/pdf_options.rb
|
284
291
|
- lib/puppeteer/page/screenshot_options.rb
|
285
292
|
- lib/puppeteer/page/screenshot_task_queue.rb
|
293
|
+
- lib/puppeteer/puppeteer.rb
|
286
294
|
- lib/puppeteer/query_handler_manager.rb
|
287
295
|
- lib/puppeteer/remote_object.rb
|
288
296
|
- lib/puppeteer/request.rb
|
data/.circleci/config.yml
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
|
3
|
-
rspec_chrome_job: &rspec_chrome_job
|
4
|
-
steps:
|
5
|
-
- checkout
|
6
|
-
- run:
|
7
|
-
command: gem install bundler:2.2.3 && bundle install
|
8
|
-
- run:
|
9
|
-
name: rspec
|
10
|
-
command: |
|
11
|
-
DEBUG=1 bundle exec rspec --profile 10 \
|
12
|
-
--format RspecJunitFormatter \
|
13
|
-
--out test_results/rspec.xml \
|
14
|
-
--format documentation
|
15
|
-
|
16
|
-
jobs:
|
17
|
-
rspec_chrome_ruby2_6:
|
18
|
-
docker:
|
19
|
-
- image: circleci/ruby:2.6.6-buster-node-browsers
|
20
|
-
<<: *rspec_chrome_job
|
21
|
-
|
22
|
-
rspec_chrome_ruby2_7:
|
23
|
-
docker:
|
24
|
-
- image: circleci/ruby:2.7.2-buster-node-browsers
|
25
|
-
<<: *rspec_chrome_job
|
26
|
-
|
27
|
-
rspec_chrome_ruby3_0:
|
28
|
-
docker:
|
29
|
-
- image: circleci/ruby:3.0.0-buster-node-browsers
|
30
|
-
<<: *rspec_chrome_job
|
31
|
-
|
32
|
-
rspec_firefox:
|
33
|
-
docker:
|
34
|
-
- image: circleci/ruby:2.7.2-buster-node-browsers
|
35
|
-
steps:
|
36
|
-
- checkout
|
37
|
-
- run:
|
38
|
-
command: gem install bundler:2.2.3 && bundle install
|
39
|
-
- run:
|
40
|
-
name: install firefox-nightly
|
41
|
-
command: |
|
42
|
-
wget -O nightly.tar.bz2 "https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US"
|
43
|
-
tar xf nightly.tar.bz2
|
44
|
-
- run:
|
45
|
-
name: rspec
|
46
|
-
command: |
|
47
|
-
DEBUG=1 PUPPETEER_PRODUCT_RSPEC=firefox \
|
48
|
-
PUPPETEER_EXECUTABLE_PATH_RSPEC=${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/firefox/firefox \
|
49
|
-
bundle exec rspec --profile 10 \
|
50
|
-
--format RspecJunitFormatter \
|
51
|
-
--out test_results/rspec.xml \
|
52
|
-
--format documentation spec/integration/
|
53
|
-
|
54
|
-
deploy:
|
55
|
-
docker:
|
56
|
-
- image: circleci/ruby:2.6.3-stretch-node
|
57
|
-
steps:
|
58
|
-
- checkout
|
59
|
-
- run:
|
60
|
-
command: gem install bundler:2.2.3 && bundle install
|
61
|
-
- run:
|
62
|
-
name: rake build
|
63
|
-
command: rake build
|
64
|
-
- run:
|
65
|
-
name: setup API key
|
66
|
-
command: |
|
67
|
-
mkdir -p ~/.gem/
|
68
|
-
echo "---" > ~/.gem/credentials
|
69
|
-
echo ":rubygems_api_key: $RUBYGEMS_API_KEY" >> ~/.gem/credentials
|
70
|
-
chmod 600 ~/.gem/credentials
|
71
|
-
- run:
|
72
|
-
name: Check Puppeteer::version
|
73
|
-
command: bundle exec ruby -e 'raise "invalid Puppeteer::VERSION" unless Puppeteer::VERSION == ENV["CIRCLE_TAG"]'
|
74
|
-
- run:
|
75
|
-
name: gem push
|
76
|
-
command: gem push pkg/puppeteer-ruby-$CIRCLE_TAG.gem
|
77
|
-
|
78
|
-
workflows:
|
79
|
-
ci:
|
80
|
-
jobs:
|
81
|
-
- rspec_chrome_ruby2_6
|
82
|
-
- rspec_chrome_ruby2_7
|
83
|
-
- rspec_chrome_ruby3_0
|
84
|
-
- rspec_firefox
|
85
|
-
rubygems-deploy:
|
86
|
-
jobs:
|
87
|
-
- deploy:
|
88
|
-
filters:
|
89
|
-
tags:
|
90
|
-
only: /^[0-9]\.[0-9]+\.[0-9].*/
|
91
|
-
branches:
|
92
|
-
ignore: /.*/
|
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Bug report
|
3
|
-
about: Create a report to help us improve
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
### Step To Reproduce / Observed behavior
|
11
|
-
|
12
|
-
|
13
|
-
### Expected behavior
|
14
|
-
|
15
|
-
### Environment
|
16
|
-
|
17
|
-
Paste the output of `ruby --version`
|
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Feature request
|
3
|
-
about: Request a new feature for playwright-ruby-client
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
### Simple description about the feature
|
11
|
-
|
12
|
-
|
13
|
-
### Usecase / Motivation
|
14
|
-
|
15
|
-
<!-- Describe why the feature helps. -->
|
data/.github/stale.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# Number of days of inactivity before an issue becomes stale
|
2
|
-
daysUntilStale: 14
|
3
|
-
# Number of days of inactivity before a stale issue is closed
|
4
|
-
daysUntilClose: 7
|
5
|
-
# Issues with these labels will never be considered stale
|
6
|
-
exemptLabels:
|
7
|
-
- security
|
8
|
-
# Label to use when marking an issue as stale
|
9
|
-
staleLabel: inactive
|
10
|
-
# Comment to post when marking an issue as stale. Set to `false` to disable
|
11
|
-
markComment: >
|
12
|
-
This issue has been automatically marked as stale because it has not had
|
13
|
-
recent activity. It will be closed if no further activity occurs. Thank you
|
14
|
-
for your contributions.
|
15
|
-
# Comment to post when closing a stale issue. Set to `false` to disable
|
16
|
-
closeComment: false
|
data/.github/workflows/docs.yml
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
name: update docs
|
2
|
-
on:
|
3
|
-
push:
|
4
|
-
branches:
|
5
|
-
- master
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
update-docs:
|
9
|
-
name: update docs
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
|
12
|
-
steps:
|
13
|
-
- name: Checkout
|
14
|
-
uses: actions/checkout@v2
|
15
|
-
|
16
|
-
- name: Set up Ruby
|
17
|
-
uses: ruby/setup-ruby@v1
|
18
|
-
with:
|
19
|
-
ruby-version: 2.7
|
20
|
-
|
21
|
-
- name: Install dependencies
|
22
|
-
run: |
|
23
|
-
gem uninstall bundler
|
24
|
-
gem install bundler -v 2.2.3
|
25
|
-
bundle install
|
26
|
-
|
27
|
-
- name: Deploy Configuration
|
28
|
-
run: |
|
29
|
-
mkdir ~/.ssh
|
30
|
-
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
31
|
-
echo "${{ secrets.DOCS_DEPLOY_SSH_RSA }}" | base64 -d > ~/.ssh/id_rsa
|
32
|
-
chmod 400 ~/.ssh/id_rsa
|
33
|
-
|
34
|
-
- name: Build and Push
|
35
|
-
run: |
|
36
|
-
git clone git@github.com:YusukeIwaki/puppeteer-ruby-docs.git docs
|
37
|
-
rm -rf docs/*
|
38
|
-
bundle exec yardoc -o docs
|
39
|
-
cp puppeteer-ruby.png docs/
|
40
|
-
cd docs/
|
41
|
-
git add -A
|
42
|
-
git config user.name github
|
43
|
-
git config user.email github@example.com
|
44
|
-
git commit -m ${{ github.sha }}
|
45
|
-
git push origin master
|
@@ -1,18 +0,0 @@
|
|
1
|
-
name: reviewdog
|
2
|
-
on: [pull_request]
|
3
|
-
jobs:
|
4
|
-
rubocop:
|
5
|
-
name: runner / rubocop
|
6
|
-
runs-on: ubuntu-latest
|
7
|
-
steps:
|
8
|
-
- name: Check out code
|
9
|
-
uses: actions/checkout@v2
|
10
|
-
- uses: ruby/setup-ruby@v1
|
11
|
-
with:
|
12
|
-
ruby-version: 3.0.0
|
13
|
-
- name: rubocop
|
14
|
-
uses: reviewdog/action-rubocop@v1
|
15
|
-
with:
|
16
|
-
github_token: ${{ secrets.github_token }}
|
17
|
-
reporter: github-pr-review
|
18
|
-
rubocop_version: 1.11.0
|
@@ -1,40 +0,0 @@
|
|
1
|
-
name: Windows check
|
2
|
-
on: [pull_request]
|
3
|
-
jobs:
|
4
|
-
windows_edge_rspec:
|
5
|
-
name: RSpec on Windows / Edge
|
6
|
-
runs-on: windows-latest
|
7
|
-
steps:
|
8
|
-
- name: Check out code
|
9
|
-
uses: actions/checkout@v2
|
10
|
-
- uses: ruby/setup-ruby@v1
|
11
|
-
with:
|
12
|
-
ruby-version: 3.0.0
|
13
|
-
- name: Install dependencies
|
14
|
-
run: |
|
15
|
-
gem uninstall bundler
|
16
|
-
gem install bundler -v 2.2.3
|
17
|
-
bundle install
|
18
|
-
- uses: browser-actions/setup-edge@latest
|
19
|
-
- name: Check example
|
20
|
-
run: bundle exec rspec spec/integration/example_spec.rb
|
21
|
-
env:
|
22
|
-
PUPPETEER_EXECUTABLE_PATH_RSPEC: 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
|
23
|
-
|
24
|
-
windows_chrome_rspec:
|
25
|
-
name: RSpec on Windows / Chrome
|
26
|
-
runs-on: windows-latest
|
27
|
-
steps:
|
28
|
-
- name: Check out code
|
29
|
-
uses: actions/checkout@v2
|
30
|
-
- uses: ruby/setup-ruby@v1
|
31
|
-
with:
|
32
|
-
ruby-version: 3.0.0
|
33
|
-
- name: Install dependencies
|
34
|
-
run: |
|
35
|
-
gem uninstall bundler
|
36
|
-
gem install bundler -v 2.2.3
|
37
|
-
bundle install
|
38
|
-
- uses: browser-actions/setup-chrome@latest
|
39
|
-
- name: Check example
|
40
|
-
run: bundle exec rspec spec/integration/example_spec.rb
|