browserstack-local 1.1.0 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 88c13f76eadbf4f7a3ce9747ccefe43b843d1557
4
- data.tar.gz: e1628e17b6092cd21d5f38568e3ff2d15f2ffef8
5
- SHA512:
6
- metadata.gz: 4a0027194af0f8c5ce6a1489684f83ac8957a6988b7d683b5d6bd3e7ce70c2ba7ccceab357e3d62b490128840fe8f1ac68350b1e730a57e8d0d1abbdadc0ade0
7
- data.tar.gz: e9092731be97e515592fa794e7f5b7961a4bf17199897cbfc774ac4b7fccf38f75eb755f067943273490dda0466d3d654dad181b8c8cdaf5af65a99c003977a6
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b6da8e88c99ecea376675b574ff5fc06aaa8efdcd40c71d86a2f1c452da3d0d4
4
+ data.tar.gz: 4cfe9d0ff64e012c443ef3e2b1bf1a7a68c89628301060a6898bb1593fc89813
5
+ SHA512:
6
+ metadata.gz: 5d26f62daa4510ddebe24a24eecceac36cb2151eae034942fbc4b0765a2ea3f9aacc66be1a66bb3070dbc17431f3e41c85bcebd4830f404921b633787f916dc4
7
+ data.tar.gz: 4337e4b3086cef7c165dea0ebe90d2d57bec931fb9b71a0c589c846a0e4c82b7d75d4eaa16574a03a0fca108311f1d247a95711621c4de85e0df590f4c5712a1
@@ -92,7 +92,7 @@ class Local
92
92
  data = JSON.parse(line) rescue {"message" => "Unable to parse daemon mode JSON output"}
93
93
  if data['state'].to_s != "connected"
94
94
  @process.close
95
- raise BrowserStack::LocalException.new(data["message"])
95
+ raise BrowserStack::LocalException.new(data["message"]["message"])
96
96
  return
97
97
  else
98
98
  @pid = data["pid"]
@@ -13,14 +13,16 @@ class LocalBinary
13
13
  @http_path = case host_os
14
14
  when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
15
15
  @windows = true
16
- "https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal.exe"
16
+ "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal.exe"
17
17
  when /darwin|mac os/
18
- "https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal-darwin-x64"
18
+ "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-darwin-x64"
19
+ when /linux-musl/
20
+ "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-alpine"
19
21
  when /linux/
20
22
  if 1.size == 8
21
- "https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal-linux-x64"
23
+ "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-x64"
22
24
  else
23
- "https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal-linux-ia32"
25
+ "https://bstack-local-prod.s3.amazonaws.com/BrowserStackLocal-linux-ia32"
24
26
  end
25
27
  end
26
28
 
@@ -42,7 +44,7 @@ class LocalBinary
42
44
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
43
45
 
44
46
  res = http.get(uri.path)
45
- file = open(binary_path, 'w')
47
+ file = open(binary_path, 'wb')
46
48
  file.write(res.body)
47
49
  file.close
48
50
  FileUtils.chmod 0755, binary_path
@@ -50,13 +52,35 @@ class LocalBinary
50
52
  binary_path
51
53
  end
52
54
 
55
+ def verify_binary(binary_path)
56
+ binary_response = IO.popen(binary_path + " --version").readline
57
+ binary_response =~ /BrowserStack Local version \d+\.\d+/
58
+ rescue Exception => e
59
+ false
60
+ end
61
+
53
62
  def binary_path
54
63
  dest_parent_dir = get_available_dirs
55
64
  binary_path = File.join(dest_parent_dir, "BrowserStackLocal#{".exe" if @windows}")
65
+
56
66
  if File.exists? binary_path
57
67
  binary_path
58
68
  else
59
- download(dest_parent_dir)
69
+ binary_path = download(dest_parent_dir)
70
+ end
71
+
72
+ valid_binary = verify_binary(binary_path)
73
+
74
+ if valid_binary
75
+ binary_path
76
+ else
77
+ binary_path = download(dest_parent_dir)
78
+ valid_binary = verify_binary(binary_path)
79
+ if valid_binary
80
+ binary_path
81
+ else
82
+ raise BrowserStack::LocalException.new('BrowserStack Local binary is corrupt')
83
+ end
60
84
  end
61
85
  end
62
86
 
metadata CHANGED
@@ -1,55 +1,45 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: browserstack-local
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.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-07-11 00:00:00 Z
11
+ date: 2022-07-20 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
- rubyforge_project:
49
- rubygems_version: 2.0.14
41
+ rubygems_version: 3.0.3.1
50
42
  signing_key:
51
43
  specification_version: 4
52
44
  summary: BrowserStack Local
53
45
  test_files: []
54
-
55
- has_rdoc: