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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d5aa5125b56608e96eae9e4eb455cdae02c5b29385ba6abb00e8e93befa8748
4
- data.tar.gz: 6894abdf4fbc3bf0e9006310c9c644a0bc764f1eec5a852cade018b94f15eb4a
3
+ metadata.gz: 48e67b88cb50ca67037dc561fb9c244800d6cebda074330aed0ee8f4aa885c8c
4
+ data.tar.gz: 4c5c145a091e75fef9af76db9779bad39c0c61f363d298b85a04462ec3480649
5
5
  SHA512:
6
- metadata.gz: cab2d5c6837fde67323a13f6d5e13b1ac341a0d3e453a225254e24f9c7091f47b79f2d739af842fc1c575a697e194ff8c1e3c496e8300d89015573347ecef687
7
- data.tar.gz: f13c77a718664573d878fbe1819cb5e538c235db4a8c80583c4686a3c04eb61be71b940b257710e3e26207950e33ebd988889303cbe86048d07c821390cbe723
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.16)
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.11)
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.11)
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: "http://webdriver.#{DOMAIN}/webdriver/v1",
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: "http://peek.#{DOMAIN}/v1",
14
+ cloud: "https://peek.#{DOMAIN}/v1",
15
15
  local_cloud: "http://localhost:3002/v1"
16
16
  }.freeze
17
17
  private_constant :SCREENSHOTS_ENDPOINT
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Superbot
4
- VERSION = "0.1.16"
4
+ VERSION = "0.1.17"
5
5
  end
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::HTTP.build(
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).start do |http|
101
- http.read_timeout = Superbot.cloud_timeout
102
- http.request(req)
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.11"
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.16
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-14 00:00:00.000000000 Z
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.11
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.11
110
+ version: 0.1.13
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bundler
113
113
  requirement: !ruby/object:Gem::Requirement