superbot 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/Gemfile.lock +3 -39
- data/lib/superbot/cli/root_command.rb +5 -0
- data/lib/superbot/cli/teleport_command.rb +2 -7
- data/lib/superbot/version.rb +1 -1
- data/lib/superbot/web.rb +6 -5
- data/lib/superbot.rb +5 -3
- 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: 5521299c6e822711616b725a18c9c60d66757301762518ab47543e8e055f4f9c
|
4
|
+
data.tar.gz: 3b5e2d80ee4c4ea7b308618517c37556c193e07f0d22a430ef2247438f521cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3046c7aada967221fb3b5833dd5cf2a1db4d33d4ddd91c59c546136b5f014ba100b14e9575f47364b7f719f6aa895ac3c519da8fb441dc1067b97266454a1a20
|
7
|
+
data.tar.gz: e370c5eae0bcbf34b520db8857d96dfb51974b780b162d2c3f1095462e0214dba02c8a59014192ee074dad063f8853c0ba93b08d797bf470b006ddb0dc20158f
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
superbot (0.1.
|
4
|
+
superbot (0.1.10)
|
5
5
|
clamp (= 1.2.1)
|
6
6
|
kommando (~> 0.1)
|
7
7
|
launchy (= 2.4.3)
|
@@ -15,22 +15,7 @@ GEM
|
|
15
15
|
specs:
|
16
16
|
addressable (2.5.2)
|
17
17
|
public_suffix (>= 2.0.2, < 4.0)
|
18
|
-
archive-zip (0.11.0)
|
19
|
-
io-like (~> 0.3.0)
|
20
18
|
ast (2.4.0)
|
21
|
-
capybara (3.6.0)
|
22
|
-
addressable
|
23
|
-
mini_mime (>= 0.1.3)
|
24
|
-
nokogiri (~> 1.8)
|
25
|
-
rack (>= 1.6.0)
|
26
|
-
rack-test (>= 0.6.3)
|
27
|
-
xpath (~> 3.1)
|
28
|
-
childprocess (0.9.0)
|
29
|
-
ffi (~> 1.0, >= 1.0.11)
|
30
|
-
chromedriver-helper (1.2.0)
|
31
|
-
archive-zip (~> 0.10)
|
32
|
-
nokogiri (~> 1.8)
|
33
|
-
cjsonci (0.1.0)
|
34
19
|
clamp (1.2.1)
|
35
20
|
coderay (1.1.2)
|
36
21
|
diff-lcs (1.3)
|
@@ -55,7 +40,6 @@ GEM
|
|
55
40
|
guard-rubocop (1.3.0)
|
56
41
|
guard (~> 2.0)
|
57
42
|
rubocop (~> 0.20)
|
58
|
-
io-like (0.3.0)
|
59
43
|
json (2.1.0)
|
60
44
|
kommando (0.1.2)
|
61
45
|
launchy (2.4.3)
|
@@ -69,13 +53,9 @@ GEM
|
|
69
53
|
mimemagic (~> 0.3.2)
|
70
54
|
method_source (0.9.0)
|
71
55
|
mimemagic (0.3.2)
|
72
|
-
mini_mime (1.0.1)
|
73
|
-
mini_portile2 (2.3.0)
|
74
56
|
multipart-post (2.0.0)
|
75
57
|
mustermann (1.0.3)
|
76
58
|
nenv (0.3.0)
|
77
|
-
nokogiri (1.8.5)
|
78
|
-
mini_portile2 (~> 2.3.0)
|
79
59
|
notiffany (0.1.1)
|
80
60
|
nenv (~> 0.1)
|
81
61
|
shellany (~> 0.0)
|
@@ -89,11 +69,9 @@ GEM
|
|
89
69
|
coderay (~> 1.1.0)
|
90
70
|
method_source (~> 0.9.0)
|
91
71
|
public_suffix (3.0.3)
|
92
|
-
rack (2.0.
|
72
|
+
rack (2.0.6)
|
93
73
|
rack-protection (2.0.3)
|
94
74
|
rack
|
95
|
-
rack-test (1.1.0)
|
96
|
-
rack (>= 1.0, < 3)
|
97
75
|
rainbow (3.0.0)
|
98
76
|
rake (10.5.0)
|
99
77
|
rb-fsevent (0.10.3)
|
@@ -121,10 +99,6 @@ GEM
|
|
121
99
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
122
100
|
ruby-progressbar (1.9.0)
|
123
101
|
ruby_dep (1.5.0)
|
124
|
-
rubyzip (1.2.2)
|
125
|
-
selenium-webdriver (3.14.0)
|
126
|
-
childprocess (~> 0.5)
|
127
|
-
rubyzip (~> 1.2)
|
128
102
|
shellany (0.0.1)
|
129
103
|
simplecov (0.16.1)
|
130
104
|
docile (~> 1.1)
|
@@ -137,21 +111,12 @@ GEM
|
|
137
111
|
rack-protection (= 2.0.3)
|
138
112
|
tilt (~> 2.0)
|
139
113
|
sinatra-silent (0.0.1)
|
140
|
-
superbot-
|
141
|
-
capybara (= 3.6.0)
|
142
|
-
cjsonci (= 0.1.0)
|
143
|
-
superbot-selenium-webdriver (= 314.2.5)
|
144
|
-
superbot-cloud (0.1.4)
|
114
|
+
superbot-cloud (0.1.5)
|
145
115
|
marcel (= 0.3.3)
|
146
116
|
multipart-post (= 2.0.0)
|
147
|
-
superbot-selenium-webdriver (314.2.5)
|
148
|
-
chromedriver-helper (= 1.2.0)
|
149
|
-
selenium-webdriver (= 3.14.0)
|
150
117
|
thor (0.20.0)
|
151
118
|
tilt (2.0.8)
|
152
119
|
unicode-display_width (1.3.3)
|
153
|
-
xpath (3.2.0)
|
154
|
-
nokogiri (~> 1.8)
|
155
120
|
zaru (0.2.0)
|
156
121
|
|
157
122
|
PLATFORMS
|
@@ -169,7 +134,6 @@ DEPENDENCIES
|
|
169
134
|
rubocop (~> 0.53)
|
170
135
|
simplecov (~> 0.16)
|
171
136
|
superbot!
|
172
|
-
superbot-capybara (~> 360.0, >= 360.0.0)
|
173
137
|
|
174
138
|
BUNDLED WITH
|
175
139
|
1.16.6
|
@@ -10,6 +10,11 @@ module Superbot
|
|
10
10
|
class RootCommand < Clamp::Command
|
11
11
|
banner "superbot 🤖"
|
12
12
|
|
13
|
+
option ['-v', '--version'], :flag, "Show version information" do
|
14
|
+
puts Superbot::VERSION
|
15
|
+
exit(0)
|
16
|
+
end
|
17
|
+
|
13
18
|
subcommand ["new"], "Create a new project", NewCommand
|
14
19
|
subcommand ["version"], "Show version information", VersionCommand
|
15
20
|
subcommand ["teleport"], "Open a teleport for superbots", TeleportCommand
|
@@ -9,18 +9,13 @@ module Superbot
|
|
9
9
|
validates_browser_type browser
|
10
10
|
end
|
11
11
|
option ['--region'], 'REGION', 'Region for remote webdriver'
|
12
|
-
option ['-u', '--user'], 'AUTH_USER_NAME', 'Cloud webdriver auth credentials', environment_variable: 'AUTH_USER_NAME', attribute_name: :auth_user
|
13
|
-
option ['-p', '--password'], 'AUTH_USER_PASSWORD', 'Cloud webdriver auth credentials', environment_variable: 'AUTH_USER_PASSWORD', attribute_name: :auth_password
|
14
12
|
|
15
13
|
def execute
|
16
|
-
@web = Superbot::Web.new(
|
17
|
-
webdriver_type: browser,
|
18
|
-
auth_user: auth_user,
|
19
|
-
auth_password: auth_password
|
20
|
-
).tap(&:run_async_after_running!)
|
14
|
+
@web = Superbot::Web.new(webdriver_type: browser).tap(&:run_async_after_running!)
|
21
15
|
|
22
16
|
@chromedriver = Kommando.run_async 'chromedriver --silent --port=9515' if browser == 'local'
|
23
17
|
puts "", "🤖 Teleport is active ☁️ "
|
18
|
+
puts "", "Configure your webdriver to http://localhost:4567/wd/hub"
|
24
19
|
|
25
20
|
$stdin.gets
|
26
21
|
ensure
|
data/lib/superbot/version.rb
CHANGED
data/lib/superbot/web.rb
CHANGED
@@ -9,7 +9,7 @@ require_relative "capybara/runner"
|
|
9
9
|
|
10
10
|
module Superbot
|
11
11
|
class Web
|
12
|
-
def initialize(webdriver_type: '
|
12
|
+
def initialize(webdriver_type: 'cloud')
|
13
13
|
@sinatra = Sinatra.new
|
14
14
|
@sinatra.set :bind, "127.0.0.1"
|
15
15
|
@sinatra.set :silent_sinatra, true
|
@@ -38,10 +38,7 @@ module Superbot
|
|
38
38
|
end
|
39
39
|
|
40
40
|
webdriver_uri = URI.parse(Superbot.webdriver_endpoint(webdriver_type))
|
41
|
-
@auth_user = auth_user
|
42
|
-
@auth_password = auth_password
|
43
41
|
@request_settings = {
|
44
|
-
userinfo: [@auth_user, @auth_password].join(':'),
|
45
42
|
host: webdriver_uri.host,
|
46
43
|
port: webdriver_uri.port,
|
47
44
|
path: webdriver_uri.path
|
@@ -82,7 +79,11 @@ module Superbot
|
|
82
79
|
)
|
83
80
|
)
|
84
81
|
req = Net::HTTP.const_get(type).new(uri, new_headers.merge('Content-Type' => 'application/json'))
|
85
|
-
|
82
|
+
|
83
|
+
if Superbot::Cloud.credentials
|
84
|
+
req.basic_auth(*Superbot::Cloud.credentials.slice(:username, :token).values)
|
85
|
+
end
|
86
|
+
|
86
87
|
req.body = body.read
|
87
88
|
Net::HTTP.new(uri.hostname, uri.port).start do |http|
|
88
89
|
http.read_timeout = Superbot.cloud_timeout
|
data/lib/superbot.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Superbot
|
4
|
+
DOMAIN = ENV.fetch('SUPERBOT_DOMAIN', 'superbot.cloud')
|
5
|
+
|
4
6
|
WEBDRIVER_ENDPOINT = {
|
5
|
-
cloud: "http://webdriver
|
7
|
+
cloud: "http://webdriver.#{DOMAIN}/webdriver/v1",
|
6
8
|
local: "http://127.0.0.1:9515",
|
7
|
-
local_cloud: "
|
9
|
+
local_cloud: "http://localhost:3000/webdriver/v1"
|
8
10
|
}.freeze
|
9
11
|
private_constant :WEBDRIVER_ENDPOINT
|
10
12
|
|
11
13
|
SCREENSHOTS_ENDPOINT = {
|
12
|
-
cloud: "http://peek
|
14
|
+
cloud: "http://peek.#{DOMAIN}/v1",
|
13
15
|
local_cloud: "http://localhost:3002/v1"
|
14
16
|
}.freeze
|
15
17
|
private_constant :SCREENSHOTS_ENDPOINT
|
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.10
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|