superbot 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/superbot.rb +2 -2
- data/lib/superbot/version.rb +1 -1
- data/lib/superbot/web.rb +10 -4
- data/superbot.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48e67b88cb50ca67037dc561fb9c244800d6cebda074330aed0ee8f4aa885c8c
|
4
|
+
data.tar.gz: 4c5c145a091e75fef9af76db9779bad39c0c61f363d298b85a04462ec3480649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c95e6295cd93d7312539d214107fc035eda32ea4c2ab782023f372dfc8cfad99c3a2430aa51bfb0c1bcb480cbc7e54a0e3a83716db3981cf088e64a57a1c7e19
|
7
|
+
data.tar.gz: 5d9d3cf7dfdc52ac3696ad903fabf095c446a1b74cee8874e8749d23735a7ef458d183b4a34b1271133f4233216811ce365218100af04a5a2f1ef191895a2a61
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
superbot (0.1.
|
4
|
+
superbot (0.1.17)
|
5
5
|
clamp (= 1.2.1)
|
6
6
|
kommando (~> 0.1)
|
7
7
|
launchy (= 2.4.3)
|
8
8
|
sinatra (= 2.0.3)
|
9
9
|
sinatra-silent (= 0.0.1)
|
10
|
-
superbot-cloud (~> 0.1.
|
10
|
+
superbot-cloud (~> 0.1.13)
|
11
11
|
zaru (= 0.2.0)
|
12
12
|
|
13
13
|
GEM
|
@@ -111,7 +111,7 @@ GEM
|
|
111
111
|
rack-protection (= 2.0.3)
|
112
112
|
tilt (~> 2.0)
|
113
113
|
sinatra-silent (0.0.1)
|
114
|
-
superbot-cloud (0.1.
|
114
|
+
superbot-cloud (0.1.13)
|
115
115
|
marcel (= 0.3.3)
|
116
116
|
multipart-post (= 2.0.0)
|
117
117
|
thor (0.20.0)
|
data/lib/superbot.rb
CHANGED
@@ -4,14 +4,14 @@ module Superbot
|
|
4
4
|
DOMAIN = ENV.fetch('SUPERBOT_DOMAIN', 'superbot.cloud')
|
5
5
|
|
6
6
|
WEBDRIVER_ENDPOINT = {
|
7
|
-
cloud: "
|
7
|
+
cloud: "https://webdriver.#{DOMAIN}/webdriver/v1",
|
8
8
|
local: "http://127.0.0.1:9515",
|
9
9
|
local_cloud: "http://localhost:3000/webdriver/v1"
|
10
10
|
}.freeze
|
11
11
|
private_constant :WEBDRIVER_ENDPOINT
|
12
12
|
|
13
13
|
SCREENSHOTS_ENDPOINT = {
|
14
|
-
cloud: "
|
14
|
+
cloud: "https://peek.#{DOMAIN}/v1",
|
15
15
|
local_cloud: "http://localhost:3002/v1"
|
16
16
|
}.freeze
|
17
17
|
private_constant :SCREENSHOTS_ENDPOINT
|
data/lib/superbot/version.rb
CHANGED
data/lib/superbot/web.rb
CHANGED
@@ -41,6 +41,7 @@ module Superbot
|
|
41
41
|
@webdriver_type = webdriver_type
|
42
42
|
webdriver_uri = URI.parse(Superbot.webdriver_endpoint(@webdriver_type))
|
43
43
|
@request_settings = {
|
44
|
+
scheme: webdriver_uri.scheme,
|
44
45
|
host: webdriver_uri.host,
|
45
46
|
port: webdriver_uri.port,
|
46
47
|
path: webdriver_uri.path
|
@@ -76,7 +77,7 @@ module Superbot
|
|
76
77
|
end
|
77
78
|
|
78
79
|
def remote_webdriver_request(type, path, query_string, body, new_headers)
|
79
|
-
uri = URI
|
80
|
+
uri = URI.const_get(@request_settings[:scheme].upcase).build(
|
80
81
|
@request_settings.merge(
|
81
82
|
path: @request_settings[:path] + path,
|
82
83
|
query: query_string.empty? ? nil : query_string
|
@@ -97,9 +98,14 @@ module Superbot
|
|
97
98
|
end
|
98
99
|
req.body = request_body
|
99
100
|
|
100
|
-
Net::HTTP.new(uri.hostname, uri.port)
|
101
|
-
|
102
|
-
http.
|
101
|
+
http = Net::HTTP.new(uri.hostname, uri.port)
|
102
|
+
if uri.scheme == 'https'
|
103
|
+
http.use_ssl = true
|
104
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
105
|
+
end
|
106
|
+
http.read_timeout = Superbot.cloud_timeout
|
107
|
+
http.start do |client|
|
108
|
+
client.request(req)
|
103
109
|
end.tap do |response|
|
104
110
|
output_response_errors(response)
|
105
111
|
end
|
data/superbot.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_runtime_dependency "launchy", "2.4.3"
|
39
39
|
spec.add_runtime_dependency "sinatra-silent", "0.0.1"
|
40
40
|
spec.add_runtime_dependency "kommando", "~> 0.1"
|
41
|
-
spec.add_runtime_dependency "superbot-cloud", "~> 0.1.
|
41
|
+
spec.add_runtime_dependency "superbot-cloud", "~> 0.1.13"
|
42
42
|
|
43
43
|
spec.add_development_dependency "bundler", "~> 1.16"
|
44
44
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Superbots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.1.
|
103
|
+
version: 0.1.13
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.1.
|
110
|
+
version: 0.1.13
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: bundler
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|