superbot-cloud 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/superbot/cloud/api.rb +1 -1
- data/lib/superbot/cloud/cli/cloud/webdriver/delete_command.rb +14 -8
- data/lib/superbot/cloud/cli/cloud/webdriver/list_command.rb +17 -7
- data/lib/superbot/cloud/version.rb +1 -1
- data/superbot-cloud.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: fc3d19c5bf6ed9f12b5b8cb85021d99e40a1aa2ee289eb3e759f5f5f3d27919b
|
4
|
+
data.tar.gz: c4876bba1c8dc2ce7d19ecc20e01d7b4846a3a86157fb95b2e4f6e113ed76f4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4548176eac8f44b4a96aa3d83a232243d633146cfe7234e028553a4ac5a83d028cb8e20d899e3c7bd47f836add0cced5df23976d284283678955df24256261cd
|
7
|
+
data.tar.gz: 7c91f01a5f93e3499ea6dc2888e4134ec085a5f89a9098fcd2e4aa9a01cab21eb01464dfa405a83dca1e5f23f02fd4a357cec4e00cf6808d80f72f594f767294
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
superbot-cloud (0.1.
|
4
|
+
superbot-cloud (0.1.16)
|
5
5
|
marcel (= 0.3.3)
|
6
6
|
multipart-post (= 2.0.0)
|
7
7
|
|
@@ -67,14 +67,14 @@ GEM
|
|
67
67
|
rack-protection (= 2.0.3)
|
68
68
|
tilt (~> 2.0)
|
69
69
|
sinatra-silent (0.0.1)
|
70
|
-
superbot (0.1.
|
70
|
+
superbot (0.1.21)
|
71
71
|
clamp (= 1.2.1)
|
72
72
|
kommando (~> 0.1)
|
73
73
|
launchy (= 2.4.3)
|
74
74
|
selenium-webdriver (~> 3.14, >= 3.14.0)
|
75
75
|
sinatra (= 2.0.3)
|
76
76
|
sinatra-silent (= 0.0.1)
|
77
|
-
superbot-cloud (~> 0.1.
|
77
|
+
superbot-cloud (~> 0.1.15)
|
78
78
|
zaru (= 0.2.0)
|
79
79
|
tilt (2.0.8)
|
80
80
|
unicode-display_width (1.4.0)
|
@@ -88,7 +88,7 @@ DEPENDENCIES
|
|
88
88
|
rake (~> 10.0)
|
89
89
|
rspec (~> 3.0)
|
90
90
|
rubocop (~> 0.53)
|
91
|
-
superbot (~> 0.1.
|
91
|
+
superbot (~> 0.1.21)
|
92
92
|
superbot-cloud!
|
93
93
|
|
94
94
|
BUNDLED WITH
|
data/lib/superbot/cloud/api.rb
CHANGED
@@ -23,7 +23,7 @@ module Superbot
|
|
23
23
|
|
24
24
|
req = Net::HTTP.const_get(
|
25
25
|
method.to_s.split('_').map(&:capitalize).join('::')
|
26
|
-
).new(uri, params.compact)
|
26
|
+
).new(uri, method == :post_multipart ? params.compact : {})
|
27
27
|
req.set_form_data(params.compact) unless method == :post_multipart
|
28
28
|
if Superbot::Cloud.credentials
|
29
29
|
req['Authorization'] = format(
|
@@ -7,7 +7,7 @@ module Superbot
|
|
7
7
|
class DeleteCommand < Clamp::Command
|
8
8
|
include Superbot::Cloud::Validations
|
9
9
|
|
10
|
-
parameter "SESSION_ID", "webdriver session ID", required: true
|
10
|
+
parameter "SESSION_ID ...", "webdriver session ID", required: true
|
11
11
|
|
12
12
|
def execute
|
13
13
|
require_login
|
@@ -15,14 +15,20 @@ module Superbot
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def delete_session
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
session_id_list.each do |session_id|
|
19
|
+
begin
|
20
|
+
Superbot::Cloud::Api.request(
|
21
|
+
:delete_webdriver_session,
|
22
|
+
params: {
|
23
|
+
session_id: session_id
|
24
|
+
}
|
25
|
+
)
|
24
26
|
|
25
|
-
|
27
|
+
puts "Webdriver session #{session_id} removal has been requested."
|
28
|
+
rescue SystemExit
|
29
|
+
p # skip to next webdriver session
|
30
|
+
end
|
31
|
+
end
|
26
32
|
end
|
27
33
|
end
|
28
34
|
end
|
@@ -7,20 +7,30 @@ module Superbot
|
|
7
7
|
class ListCommand < Clamp::Command
|
8
8
|
include Superbot::Cloud::Validations
|
9
9
|
|
10
|
+
option %w[-q --quiet], :flag, "Only show webdriver session IDs"
|
11
|
+
option %w[-a --all], :flag, "Show all the sessions (including finished)"
|
12
|
+
|
10
13
|
def execute
|
11
14
|
require_login
|
12
15
|
list_sessions
|
13
16
|
end
|
14
17
|
|
15
18
|
def list_sessions
|
16
|
-
|
19
|
+
states = all? ? nil : %w[idle proxying]
|
20
|
+
api_response = Superbot::Cloud::Api.request(:webdriver_session_list, params: { 'aasm_state[]': states })
|
17
21
|
abort api_response[:error] if api_response[:error]
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
|
23
|
+
abort "No sessions found" if api_response[:webdriver_sessions].empty?
|
24
|
+
|
25
|
+
if quiet?
|
26
|
+
puts(api_response[:webdriver_sessions].map { |session| session[:session_id] })
|
27
|
+
else
|
28
|
+
headers = api_response[:webdriver_sessions].first&.keys
|
29
|
+
puts headers.map { |field| field.to_s.upcase.ljust(35) }.join
|
30
|
+
puts ''.ljust(35 * headers.length, '-')
|
31
|
+
api_response[:webdriver_sessions].each do |webdriver_session|
|
32
|
+
puts webdriver_session.values.map { |v| v.to_s.ljust(35) }.join
|
33
|
+
end
|
24
34
|
end
|
25
35
|
end
|
26
36
|
end
|
data/superbot-cloud.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_runtime_dependency "multipart-post", "2.0.0"
|
37
37
|
spec.add_runtime_dependency "marcel", "0.3.3"
|
38
38
|
|
39
|
-
spec.add_development_dependency "superbot", "~> 0.1.
|
39
|
+
spec.add_development_dependency "superbot", "~> 0.1.21"
|
40
40
|
spec.add_development_dependency "bundler", "~> 1.16"
|
41
41
|
spec.add_development_dependency "rake", "~> 10.0"
|
42
42
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbot-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.
|
47
|
+
version: 0.1.21
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.
|
54
|
+
version: 0.1.21
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|