device_api-android 1.2.13 → 1.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/device_api/android.rb +4 -3
- data/lib/device_api/android/adb.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 954b87d6422723684ae0f58a992d7890f6db4549
|
4
|
+
data.tar.gz: 1a7197b642bec9449212cc3d96ac264df79f24d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec48e6fcb9be5e89424df449222b85a2c63283f3cae9f923291bd593da11fdd5dd2d6cb3dbdd36174ec9d9c69cd724e1bc79d84c86c317c03c1bd3657929a5c1
|
7
|
+
data.tar.gz: 862ffb62b7ae8a27b20480b57832eea450f432e57a06eb530984133c1083354f95c19e03b5098279cced8af49020fde448933db2c68db9bdb7c7600df6d98de3
|
data/lib/device_api/android.rb
CHANGED
@@ -31,7 +31,8 @@ module DeviceAPI
|
|
31
31
|
if serial.to_s.empty?
|
32
32
|
raise DeviceAPI::BadSerialString.new("serial was '#{serial.nil? ? 'nil' : serial}'")
|
33
33
|
end
|
34
|
-
|
34
|
+
device = ADB.devices.select {|k| k.keys.first == serial}
|
35
|
+
state = device.first[serial] || 'unknown'
|
35
36
|
remote = check_if_remote_device?(serial)
|
36
37
|
DeviceAPI::Android::Device.create( self.get_device_type({ :"#{serial}" => state}), { serial: serial, state: state, remote: remote })
|
37
38
|
end
|
@@ -57,13 +58,13 @@ module DeviceAPI
|
|
57
58
|
def self.get_device_type(options)
|
58
59
|
return :default if ['unauthorized', 'offline', 'unknown'].include? options.values.first
|
59
60
|
serial = options.keys.first
|
60
|
-
state =
|
61
|
+
state = options.values.first
|
61
62
|
begin
|
62
63
|
man = Device.new(serial: serial, state: state).manufacturer
|
63
64
|
rescue DeviceAPI::DeviceNotFound
|
64
65
|
return :default
|
65
66
|
rescue => e
|
66
|
-
puts "Unrecognised exception whilst finding device '#{serial}' (state: #{
|
67
|
+
puts "Unrecognised exception whilst finding device '#{serial}' (state: #{state})"
|
67
68
|
puts e.message
|
68
69
|
puts e.backtrace.inspect
|
69
70
|
return :default
|
@@ -25,7 +25,7 @@ module DeviceAPI
|
|
25
25
|
# @param qualifier qualifier of device
|
26
26
|
# @return (String) device state
|
27
27
|
def self.get_state(qualifier)
|
28
|
-
result = execute('adb
|
28
|
+
result = execute('adb -s #{qualifier} get-state')
|
29
29
|
|
30
30
|
raise ADBCommandError.new(result.stderr) if result.exit != 0
|
31
31
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: device_api-android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Buckhurst
|
@@ -11,34 +11,34 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: device_api
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- - ~>
|
20
|
+
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.0.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - ~>
|
27
|
+
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.0.2
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- - ~>
|
34
|
+
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '3'
|
37
37
|
type: :development
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- - ~>
|
41
|
+
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '3'
|
44
44
|
description: Android implementation of DeviceAPI
|
@@ -48,17 +48,17 @@ extensions: []
|
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
50
|
- README.md
|
51
|
+
- lib/device_api/android.rb
|
51
52
|
- lib/device_api/android/aapt.rb
|
52
53
|
- lib/device_api/android/adb.rb
|
54
|
+
- lib/device_api/android/device.rb
|
53
55
|
- lib/device_api/android/device/kindle.rb
|
54
56
|
- lib/device_api/android/device/samsung.rb
|
55
|
-
- lib/device_api/android/device.rb
|
56
57
|
- lib/device_api/android/plugins/audio.rb
|
57
58
|
- lib/device_api/android/plugins/battery.rb
|
58
59
|
- lib/device_api/android/plugins/disk.rb
|
59
60
|
- lib/device_api/android/plugins/memory.rb
|
60
61
|
- lib/device_api/android/signing.rb
|
61
|
-
- lib/device_api/android.rb
|
62
62
|
homepage: https://github.com/bbc/device_api-android
|
63
63
|
licenses:
|
64
64
|
- MIT
|
@@ -69,17 +69,17 @@ require_paths:
|
|
69
69
|
- lib
|
70
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.5.1
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Android Device Management API
|