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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d1b40002f08217e0ca4388dd5dd84e00035aabc76ac16d47fa318d96ae23770
4
- data.tar.gz: 6d5b75d177154480ee22ef295b1de8c86f8fd19a028db382e7854d2df5d62fa7
3
+ metadata.gz: fc3d19c5bf6ed9f12b5b8cb85021d99e40a1aa2ee289eb3e759f5f5f3d27919b
4
+ data.tar.gz: c4876bba1c8dc2ce7d19ecc20e01d7b4846a3a86157fb95b2e4f6e113ed76f4a
5
5
  SHA512:
6
- metadata.gz: e50da0fead65be52a49954d90ded6b9d997aa21cb1bd7e43a2127ca62d5a64cec6d889524d267367a81d20b14d3b0a7ca891c14b1b4e0c447e94502bb4f99448
7
- data.tar.gz: 8392a6b5fa3f880bb0495b89e779cdbe625befb32eb5c1e648e8f2d3c2987e3addc4921cfbf7a632647a8d7cfb0a681503e2e5f22020bef71dde21d3d7698eac
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.15)
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.20)
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.14)
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.20)
91
+ superbot (~> 0.1.21)
92
92
  superbot-cloud!
93
93
 
94
94
  BUNDLED WITH
@@ -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
- Superbot::Cloud::Api.request(
19
- :delete_webdriver_session,
20
- params: {
21
- session_id: session_id
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
- puts "Webdriver session removal has been requested."
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
- api_response = Superbot::Cloud::Api.request(:webdriver_session_list)
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
- puts "Webdriver Sessions:"
19
- headers = api_response[:webdriver_sessions].first&.keys
20
- puts headers.map { |field| field.to_s.upcase.ljust(35) }.join
21
- puts ''.ljust(35 * headers.length, '-')
22
- api_response[:webdriver_sessions].each do |webdriver_session|
23
- puts webdriver_session.values.map { |v| v.to_s.ljust(35) }.join
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Superbot
4
4
  module Cloud
5
- VERSION = "0.1.15"
5
+ VERSION = "0.1.16"
6
6
  end
7
7
  end
@@ -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.20"
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.15
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-22 00:00:00.000000000 Z
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.20
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.20
54
+ version: 0.1.21
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement