device_api-android 1.2.10 → 1.2.11

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
  SHA1:
3
- metadata.gz: f2949c4bb240ed0f093b79db016d0d36156db4b4
4
- data.tar.gz: 18bf69ed9c381eee30d2229efff6481a5adab406
3
+ metadata.gz: 0b60870bbe796b5e2159978faead21a5260f4d9f
4
+ data.tar.gz: a6eff328f6783300d43e12fe42037fd3e573643d
5
5
  SHA512:
6
- metadata.gz: 77e3bd2c0c489a7a4334203bbc37ee3bb7a2792e048894aa845a998069b25016f73953af459ff724b2772749645820143334f29970fc24d8c829e5a5369913d4
7
- data.tar.gz: 80b1257860b39542b8b088db4086d876fe9bb2cf4c82cd75668a4e69715e94fbd5712e3ef1e171dc101823f5cc1f032afc5879a7429efee7d870fdaec8db8f5a
6
+ metadata.gz: 519fcb4f8f592fdcc7980ad36c73c84983d70e4a17b82c21c3720b66fd9b1b568a612e451b162fec8e6791052ad09b7933c783ccf7e035a892aa8ca614aa774f
7
+ data.tar.gz: 0dea576c56c809f100b62796756798cc24d1e0d5ccfeccc9bc2186384ddd6d4c03bcbe2bfef5e3b52e1c51278ffd8c3f2582435d77381849d26f375656441045
data/README.md CHANGED
@@ -45,13 +45,15 @@ You can use device.is_remote? to determine if the device is a remote device, e.g
45
45
 
46
46
  device.is_remote?
47
47
 
48
- DeviceAPI::Android::ADB::DeviceAlreadyConnectedError is raised when DeviceAPI::Android.connect is called on an already connected device.
48
+ ### Error messages
49
49
 
50
- DeviceAPI::Android::DeviceDisconnectedWhenNotARemoteDevice is raised when we are attempting to call disconnect on a device that is not a remote device, e.g. it has no hope of being disconnected from.
50
+ Here are some of the errors you may encounter as well as a example of what can cause them:
51
51
 
52
- DeviceAPI::Android::ADBCommandError is raised when we cannot connect to a device, e.g. adb times out.
52
+ `DeviceAPI::Android::ADB::DeviceAlreadyConnectedError` - raised when DeviceAPI::Android.connect is called on an currently connected device.
53
53
 
54
- DeviceAPI::Android::ADBCommandError is raised when we cannot disconnect from a device, e.g. adb times out or we were already disconnected.
54
+ `DeviceAPI::Android::DeviceDisconnectedWhenNotARemoteDevice` - raised when we are attempting to call disconnect on a non-remote device.
55
+
56
+ `DeviceAPI::Android::ADBCommandError` - raised when we cannot connect to a device, e.g. adb times out.
55
57
 
56
58
  ### Detecting devices
57
59
 
@@ -11,7 +11,7 @@ module DeviceAPI
11
11
  class Device < DeviceAPI::Device
12
12
  attr_reader :qualifier
13
13
 
14
- @@subclasses; @@subclasses = {}
14
+ @@subclasses = {}
15
15
 
16
16
  # Called by any inheritors to register themselves with the parent class
17
17
  def self.inherited(klass)
@@ -7,12 +7,16 @@ module DeviceAPI
7
7
  # work due to Amazons implementation of the Keyguard.
8
8
  def unlock
9
9
  ADB.keyevent(qualifier, '26') unless screen_on?
10
+
11
+ return ADB.swipe(qualifier, {x_from: 900, y_from: 500, x_to: 300, y_to: 500}) if version.split('.').first.to_i < 5
12
+
10
13
  if orientation == :landscape
11
- ADB.swipe(qualifier, { x_from: 500, y_from: 750, x_to: 500, y_to: 250 } ) if version.split('.').first.to_i >= 5
12
- ADB.swipe(qualifier, { x_from: 900, y_from: 500, x_to: 300, y_to: 500 } ) if version.split('.').first.to_i < 5
14
+ coords = { x_from: 500, y_from: 750, x_to: 500, y_to: 250 }
13
15
  else
14
- ADB.swipe(qualifier, { x_from: 300, y_from: 900, x_to: 300, y_to: 600 } )
16
+ coords = { x_from: 300, y_from: 900, x_to: 300, y_to: 600 }
15
17
  end
18
+
19
+ ADB.swipe(qualifier, coords)
16
20
  end
17
21
  end
18
22
  end
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.10
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Buckhurst
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-10-03 00:00:00.000000000 Z
14
+ date: 2016-10-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: device_api
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  requirements: []
81
81
  rubyforge_project:
82
- rubygems_version: 2.5.1
82
+ rubygems_version: 2.5.0
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Android Device Management API