appium_connect 1.1.10 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AppiumConnect.rb +10 -16
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b473166f4e94e247259b1517ed0edb2f1402ffb
4
- data.tar.gz: a3afd08f979f61c54db2b6392782398fb4550f07
3
+ metadata.gz: 297680a6f17130366110d2c57fd35547df73e880
4
+ data.tar.gz: aee33922831f6e66ed5bf83e96d613f8dc83c64a
5
5
  SHA512:
6
- metadata.gz: a3fa4c7bcb0fc1dcdbbc4fe3d0e7738bee92be128c861c7cc4aa420c6f8956cfc9da6e5c2a6177784d0a1d85d6e17f68547c933aa65144ea916efa8297d894a9
7
- data.tar.gz: 3fa409f395acd850e42e873c5ceae01564c672265c192d6bfa0eb65ffca3b49483e8ad7bfee9024e1a3ae5ddb2b5ce145c99bd7630cfa03967540e9cc782b838
6
+ metadata.gz: 7bbc54d68aa23da78b29e2fc8451f933fc8f65a9ce6e117af178e2213ddc36baa45629e23580d2a596aeea0c7ec05ff90c00c76d9b3f1e3e11ea0edc5f688b3c
7
+ data.tar.gz: dcaed1ef05f40340c1f9fdebf20f0dec4c418f82ed240d883d93eb967b63b4a219a93dffeb586a7e9475b25ccd79a625f20a4c561ff1a8b931675b19349edfc9
data/lib/AppiumConnect.rb CHANGED
@@ -14,30 +14,24 @@ if input_array.include? '--restart'
14
14
  restart_devices
15
15
  else
16
16
 
17
- platform = get_platform()
18
- if platform == :windows
19
- GetShortPathName = Win32API.new('kernel32', 'GetShortPathName', 'ppi', 'i')
20
- end
21
-
22
- def get_windows_path(path)
23
- len = GetShortPathName.call(path, nil, 0)
24
-
25
- raise if len.zero?
26
-
27
- buffer = "\0" * len
28
- GetShortPathName.call(path, buffer, len)
29
- buffer.tr('/', '\\')
30
- end
31
-
17
+ def get_short_win32_filename(long_name)
18
+ require 'win32api'
19
+ win_func = Win32API.new("kernel32","GetShortPathName","PPL"," L")
20
+ buf = 0.chr * 256
21
+ buf[0..long_name.length-1] = long_name
22
+ win_func.call(long_name, buf, buf.length)
23
+ return buf.split(0.chr).first
24
+ end
32
25
 
33
26
 
34
27
 
28
+ platform = get_platform()
35
29
  if platform == :linux
36
30
  nodeConfigDir = File.expand_path('~/AppiumConnect/')
37
31
  elsif platform == :mac
38
32
  nodeConfigDir = File.expand_path('~/AppiumConnect/')
39
33
  elsif platform == :windows
40
- nodeConfigDir = get_windows_path(Dir.home() + '/AppiumConnect')
34
+ nodeConfigDir = get_short_win32_filename(Dir.home() + '/AppiumConnect')
41
35
  end
42
36
 
43
37
  create_dir nodeConfigDir
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Watson