adb_device 0.1.1 → 0.2.0

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: 84a041bb60fe90fd7a34aae4362541801bfb26264674d2ca2e75c3f413fc712b
4
- data.tar.gz: 445de251698e87d7b33b30aa74a8e3062e0a73bd92a85cd86b746aa4a3977c14
3
+ metadata.gz: 86e8137b39282bd2d4a427ee47e17c0958f181dfacabcd819e24f209fd547754
4
+ data.tar.gz: b1d0018e0acca42fa045991eab4752a64b04a98656fde5b1e327737b261f8685
5
5
  SHA512:
6
- metadata.gz: f651935a32c9b5ab3e4a124a142ec34346cbc4669ec75703cf9468854251368eede18e0cdb1172117277ff4cf4e8daf7595bf5126d8e3fa5662dc4b109afdd26
7
- data.tar.gz: 4173fd7c43ca72428df242e4eed778d9bc0fce481a3e61e88f3d741eef1a2c65cc11be629185064709f1c6ed510d8bad4e3d9640b3f07104262a81cc0df4f69b
6
+ metadata.gz: 4dd15ada3316966b9c78eb5c730d03f4161b14eebdeeae5cdeffe871dad10515f357a17e7833a246eb65f4259f16278206e755f734f741271b89d34e3f58c6c6
7
+ data.tar.gz: fae47032c4714abedbc5970b88d4395f351d95b16f59abe9a93defada5fb96494afb87ea760b70911802794d14b7f5ee6d4e9364cbaf772cf44698943ddaf036
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adb_device (0.1.1)
4
+ adb_device (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,21 +1,18 @@
1
1
  require "adb_device/version"
2
+ require "adb_device/device"
2
3
 
3
4
  module AdbDevice
4
5
  class Error < StandardError; end
5
-
6
- class Device
7
- def initialize(sn)
8
- @sn = sn
9
- end
10
6
 
11
- def brand
12
- output = `adb -s #{@sn} shell getprop ro.product.brand`
13
- brand = output.tr("\n", "")
7
+ def AdbDevice.device_list
8
+ output = `adb devices`
9
+ udids = []
10
+ if output.match?(/\n([0-9a-zA-Z].+)\t/)
11
+ udids = output.scan(/\n([0-9a-zA-Z].+)\t/).flatten
12
+ else
13
+ return "No devices connected"
14
+ end
15
+ udids
14
16
  end
15
17
 
16
- def model
17
- output = `adb -s #{@sn} shell getprop ro.product.model`
18
- model = output.tr("\n", "")
19
- end
20
- end
21
18
  end
@@ -0,0 +1,18 @@
1
+
2
+ module AdbDevice
3
+ class Device
4
+ def initialize(sn)
5
+ @sn = sn
6
+ end
7
+
8
+ def brand
9
+ output = `adb -s #{@sn} shell getprop ro.product.brand`
10
+ brand = output.tr("\n", "")
11
+ end
12
+
13
+ def model
14
+ output = `adb -s #{@sn} shell getprop ro.product.model`
15
+ model = output.tr("\n", "")
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module AdbDevice
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adb_device
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristaps Indriksons
@@ -56,6 +56,7 @@ files:
56
56
  - bin/console
57
57
  - bin/setup
58
58
  - lib/adb_device.rb
59
+ - lib/adb_device/device.rb
59
60
  - lib/adb_device/version.rb
60
61
  homepage: https://rubygems.org/gems/adb_device
61
62
  licenses: []