browserstack-local 1.2.0 → 1.3.0

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 +7 -7
  2. data/lib/browserstack/localbinary.rb +23 -1
  3. metadata +19 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- data.tar.gz: 6b4e316e95657f8c58585db0ab6b7226076280e9
4
- metadata.gz: b25fa6538f32d3567fdfe1e49405346edd9fb5b8
5
- SHA512:
6
- data.tar.gz: bd4560bde812010f358e2bc6f07282aea931441c5387810e7eba3536b74e9165f5ecc02ebd2ed990253aa72e129cbe4c2cdd10c1258c72e7f4c9ab2c6362594a
7
- metadata.gz: b8ad2ee74ec3b495c32cc47d77eea3080b123bfb6fca12a633d704b1fde5257cea77e84251461856c9343dc5d74b006fd1aef863bd7463cec56f88508a0b7ef1
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a9f2fb5a2998d8a0ef30547374adc5ceae6c802c
4
+ data.tar.gz: a134189cab2eee5826661b43cf5afaf0031a1726
5
+ SHA512:
6
+ metadata.gz: 79b5cdeabd670e174a921a9dc97d729ca3c6d9bfb26cd9c93868edf810034f2be092f0990e7baeadf1a7aa06c6ac013a91ea58a2101dcb281f2b401825f65133
7
+ data.tar.gz: fc9c57f13da8f99f22fb8513306295b2921316af96e0236985562d48a28865cb7fdd5c293c4a35f04f969159319f1624d803f02054836ab6fc45ba5cbd8d647f
@@ -50,13 +50,35 @@ class LocalBinary
50
50
  binary_path
51
51
  end
52
52
 
53
+ def verify_binary(binary_path)
54
+ binary_response = IO.popen(binary_path + " --version").readline
55
+ binary_response =~ /BrowserStack Local version \d+\.\d+/
56
+ rescue Exception => e
57
+ false
58
+ end
59
+
53
60
  def binary_path
54
61
  dest_parent_dir = get_available_dirs
55
62
  binary_path = File.join(dest_parent_dir, "BrowserStackLocal#{".exe" if @windows}")
63
+
56
64
  if File.exists? binary_path
57
65
  binary_path
58
66
  else
59
- download(dest_parent_dir)
67
+ binary_path = download(dest_parent_dir)
68
+ end
69
+
70
+ valid_binary = verify_binary(binary_path)
71
+
72
+ if valid_binary
73
+ binary_path
74
+ else
75
+ binary_path = download(dest_parent_dir)
76
+ valid_binary = verify_binary(binary_path)
77
+ if valid_binary
78
+ binary_path
79
+ else
80
+ raise BrowserStack::LocalException.new('BrowserStack Local binary is corrupt')
81
+ end
60
82
  end
61
83
  end
62
84
 
metadata CHANGED
@@ -1,54 +1,46 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: browserstack-local
3
- version: !ruby/object:Gem::Version
4
- version: 1.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - BrowserStack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2016-09-19 00:00:00 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
13
12
  dependencies: []
14
-
15
13
  description: Ruby bindings for BrowserStack Local
16
14
  email: support@browserstack.com
17
15
  executables: []
18
-
19
16
  extensions: []
20
-
21
17
  extra_rdoc_files: []
22
-
23
- files:
18
+ files:
24
19
  - lib/browserstack/local.rb
25
20
  - lib/browserstack/localbinary.rb
26
21
  - lib/browserstack/localexception.rb
27
22
  homepage: http://rubygems.org/gems/browserstack-local
28
- licenses:
23
+ licenses:
29
24
  - MIT
30
25
  metadata: {}
31
-
32
26
  post_install_message:
33
27
  rdoc_options: []
34
-
35
- require_paths:
28
+ require_paths:
36
29
  - lib
37
- required_ruby_version: !ruby/object:Gem::Requirement
38
- requirements:
39
- - &id001
40
- - ">="
41
- - !ruby/object:Gem::Version
42
- version: "0"
43
- required_rubygems_version: !ruby/object:Gem::Requirement
44
- requirements:
45
- - *id001
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
46
40
  requirements: []
47
-
48
41
  rubyforge_project:
49
- rubygems_version: 2.0.14
42
+ rubygems_version: 2.4.8
50
43
  signing_key:
51
44
  specification_version: 4
52
45
  summary: BrowserStack Local
53
46
  test_files: []
54
-