Dhalang 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -12
- data/lib/Dhalang/version.rb +1 -1
- data/lib/js/dhalang.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b5a8f2427673c1a21cbbfcc3f9b3119c11890b9dbb21a1656ec970c14b4faef
|
4
|
+
data.tar.gz: d98cac7a86e5c12c0fc845e71a8810c3adaa3c583fb53a4139f2e1408231cceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 142fcef44cc80374790a915356c7eda5b5a5d91e532c44a4a81515f07454b9c2a7a04d34d53b3cb481fb0ed2f58cc6a0ed974a0ad4d244e9622f754e32e47624
|
7
|
+
data.tar.gz: 8379ed46f315e7cf3cfa657c2972fbdc3e34bee4255f2be741e84835c82536d4ace52290fb0197e1638a77667fa0a59309357ce62bca3887ba746c44665d8e9c
|
data/README.md
CHANGED
@@ -84,25 +84,25 @@ Below table lists all possible configuration parameters that can be set:
|
|
84
84
|
|
85
85
|
## Examples of using Dhalang
|
86
86
|
To return a PDF from a Rails controller you can do the following:
|
87
|
-
```
|
88
|
-
def example_controller_method
|
89
|
-
|
90
|
-
|
87
|
+
```ruby
|
88
|
+
def example_controller_method
|
89
|
+
binary_pdf = Dhalang::PDF.get_from_url("https://www.google.com")
|
90
|
+
send_data(binary_pdf, filename: 'pdfofgoogle.pdf', type: 'application/pdf')
|
91
91
|
end
|
92
92
|
```
|
93
93
|
|
94
94
|
To return a PNG from a Rails controller you can do the following:
|
95
|
-
```
|
96
|
-
def example_controller_method
|
97
|
-
|
98
|
-
|
95
|
+
```ruby
|
96
|
+
def example_controller_method
|
97
|
+
binary_png = Dhalang::Screenshot.get_from_url_as_png("https://www.google.com")
|
98
|
+
send_data(binary_png, filename: 'screenshotofgoogle.png', type: 'image/png')
|
99
99
|
end
|
100
100
|
```
|
101
101
|
|
102
102
|
To return a JPEG from a Rails controller you can do the following:
|
103
|
-
```
|
104
|
-
def example_controller_method
|
105
|
-
|
106
|
-
|
103
|
+
```ruby
|
104
|
+
def example_controller_method
|
105
|
+
binary_jpeg = Dhalang::Screenshot.get_from_url_as_jpeg("https://www.google.com")
|
106
|
+
send_data(binary_jpeg, filename: 'screenshotofgoogle.jpeg', type: 'image/jpeg')
|
107
107
|
end
|
108
108
|
```
|
data/lib/Dhalang/version.rb
CHANGED
data/lib/js/dhalang.js
CHANGED
@@ -74,7 +74,7 @@ exports.configure = async function (page, userOptions) {
|
|
74
74
|
}
|
75
75
|
|
76
76
|
if (userOptions.httpAuthenticationCredentials !== "") {
|
77
|
-
await page.authenticate(userOptions.
|
77
|
+
await page.authenticate(userOptions.httpAuthenticationCredentials)
|
78
78
|
}
|
79
79
|
}
|
80
80
|
|
@@ -143,4 +143,4 @@ exports.getWaitingParameters = function (configuration) {
|
|
143
143
|
return {
|
144
144
|
timeout: configuration.userOptions.navigationTimeout
|
145
145
|
}
|
146
|
-
}
|
146
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Dhalang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niels Steensma
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|