stf-client 0.3.0.rc8 → 0.3.0.rc9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/di.rb +4 -0
- data/lib/stf/client.rb +0 -1
- data/lib/stf/interactor/get_keys_interactor.rb +0 -2
- data/lib/stf/interactor/get_values_interactor.rb +0 -2
- data/lib/stf/interactor/start_debug_session_interactor.rb +3 -25
- data/lib/stf/interactor/start_one_debug_session_interactor.rb +0 -2
- data/lib/stf/interactor/stop_all_debug_sessions_interactor.rb +0 -1
- data/lib/stf/interactor/stop_debug_session_interactor.rb +0 -1
- data/lib/stf/model/device_list.rb +0 -1
- data/lib/stf/validate/uri_validator.rb +7 -0
- data/lib/stf/version.rb +1 -1
- data/lib/stf/view/cli.rb +4 -1
- metadata +3 -4
- data/lib/stf/errors.rb +0 -7
- data/lib/stf/model/session.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f3cd4d6b212dc0c25d4e73cf47b856df1ebef24
|
4
|
+
data.tar.gz: 689022a5a8023bccaaa6c1ec0b2c1b61f46a5bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22f0b4d6c29be20d704f17ec2fe3714ad322af0ecd0f996ced4fc04c8c22689176ce90a002249906b61cc628094e02410fba4d26f069005db8462435ac7fe38d
|
7
|
+
data.tar.gz: ed26145ed4eb3675405313ba312462ca9172dc793b8146f0cb7dba0ec3191a34f7a11dc47b1f5be66b4377e8d3b6b77960d195608f3c584b5dff5f960f166a7e
|
data/README.md
CHANGED
@@ -48,7 +48,7 @@ COMMANDS
|
|
48
48
|
connect - Search for a device available in STF and attach it to local adb server
|
49
49
|
disconnect - Disconnect device(s) from local adb server and remove device(s) from user devices in STF
|
50
50
|
help - Shows a list of commands or help for one command
|
51
|
-
keys - Show
|
51
|
+
keys - Show available keys for filtering
|
52
52
|
values - Show known values for the filtering key
|
53
53
|
|
54
54
|
ENVIRONMENT VARIABLES
|
data/lib/di.rb
CHANGED
@@ -9,6 +9,7 @@ require 'stf/interactor/stop_all_debug_sessions_interactor'
|
|
9
9
|
require 'stf/interactor/remove_all_user_devices_interactor'
|
10
10
|
require 'stf/interactor/get_keys_interactor'
|
11
11
|
require 'stf/interactor/get_values_interactor'
|
12
|
+
require 'stf/validate/uri_validator'
|
12
13
|
|
13
14
|
class DI
|
14
15
|
class << self
|
@@ -60,6 +61,9 @@ class DI
|
|
60
61
|
-> {Stf::RemoveAllUserDevicesInteractor.new},
|
61
62
|
memoize: true)
|
62
63
|
|
64
|
+
c.register(:uri_validator,
|
65
|
+
-> {Stf::URIValidator.new},
|
66
|
+
memoize: true)
|
63
67
|
end
|
64
68
|
|
65
69
|
def [](what)
|
data/lib/stf/client.rb
CHANGED
@@ -2,8 +2,6 @@ require 'ADB'
|
|
2
2
|
|
3
3
|
require 'stf/client'
|
4
4
|
require 'stf/log/log'
|
5
|
-
require 'stf/errors'
|
6
|
-
require 'stf/model/session'
|
7
5
|
require 'stf/model/device_list'
|
8
6
|
|
9
7
|
module Stf
|
@@ -32,11 +30,11 @@ module Stf
|
|
32
30
|
begin
|
33
31
|
connect_loop(all_flag, wanted, filter, false, 5, start_timeout)
|
34
32
|
rescue SignalException => e
|
35
|
-
logger.info "Caught signal #{e.message}"
|
33
|
+
logger.info "Caught signal \"#{e.message}\""
|
36
34
|
DI[:stop_all_debug_sessions_interactor].execute
|
37
35
|
return false
|
38
|
-
rescue
|
39
|
-
logger.info "Exception #{e.message} during initial connect loop"
|
36
|
+
rescue Exception => e
|
37
|
+
logger.info "Exception \"#{e.message}\" during initial connect loop"
|
40
38
|
DI[:stop_all_debug_sessions_interactor].execute
|
41
39
|
return false
|
42
40
|
end
|
@@ -116,25 +114,5 @@ module Stf
|
|
116
114
|
DI[:stop_debug_session_interactor].execute(url)
|
117
115
|
end
|
118
116
|
end
|
119
|
-
|
120
|
-
def connect(filter, all_flag, wanted)
|
121
|
-
devices = DeviceList.new(DI[:stf].get_devices)
|
122
|
-
devices = devices.filterReadyToConnect
|
123
|
-
devices = devices.byFilter(filter) if filter
|
124
|
-
|
125
|
-
if devices.empty?
|
126
|
-
logger.error 'There is no available devices with criteria ' + filter
|
127
|
-
return 0
|
128
|
-
end
|
129
|
-
|
130
|
-
n = 0
|
131
|
-
devices.asArray.shuffle.each do |d|
|
132
|
-
n += 1 if DI[:start_one_debug_session_interactor].execute(d)
|
133
|
-
break if !all_flag && n >= wanted
|
134
|
-
end
|
135
|
-
|
136
|
-
n
|
137
|
-
end
|
138
|
-
|
139
117
|
end
|
140
118
|
end
|
data/lib/stf/version.rb
CHANGED
data/lib/stf/view/cli.rb
CHANGED
@@ -35,6 +35,9 @@ module Stf
|
|
35
35
|
Log::verbose(global_options[:verbose])
|
36
36
|
|
37
37
|
DI.init(global_options)
|
38
|
+
|
39
|
+
help_now!('Valid STF url is required, e.g. http(s)://openstf.local') if !DI[:uri_validator].validate(global_options[:url])
|
40
|
+
true
|
38
41
|
end
|
39
42
|
|
40
43
|
desc 'Search for a device available in STF and attach it to local adb server'
|
@@ -61,7 +64,7 @@ module Stf
|
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
64
|
-
desc 'Show
|
67
|
+
desc 'Show available keys for filtering'
|
65
68
|
command :keys do |c|
|
66
69
|
c.action {puts DI[:get_keys_interactor].execute}
|
67
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stf-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0.
|
4
|
+
version: 0.3.0.rc9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Malinskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -199,7 +199,6 @@ files:
|
|
199
199
|
- lib/di.rb
|
200
200
|
- lib/stf.rb
|
201
201
|
- lib/stf/client.rb
|
202
|
-
- lib/stf/errors.rb
|
203
202
|
- lib/stf/interactor/get_keys_interactor.rb
|
204
203
|
- lib/stf/interactor/get_values_interactor.rb
|
205
204
|
- lib/stf/interactor/remove_all_user_devices_interactor.rb
|
@@ -210,8 +209,8 @@ files:
|
|
210
209
|
- lib/stf/log/log.rb
|
211
210
|
- lib/stf/model/device.rb
|
212
211
|
- lib/stf/model/device_list.rb
|
213
|
-
- lib/stf/model/session.rb
|
214
212
|
- lib/stf/system/demonizer.rb
|
213
|
+
- lib/stf/validate/uri_validator.rb
|
215
214
|
- lib/stf/version.rb
|
216
215
|
- lib/stf/view/cli.rb
|
217
216
|
- stf-client.gemspec
|
data/lib/stf/errors.rb
DELETED