u3d 1.0.17 → 1.0.18

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
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bfe15495d57985fcde5de0b62fd24f2e93030a7
4
- data.tar.gz: c8dad256767bc49fcad1cac195063619dc386b05
3
+ metadata.gz: b9238d65caf5c8cd801183c0026863160a1a1441
4
+ data.tar.gz: fafc5dfb82ddc9ffea6f2a41d062514dd625b861
5
5
  SHA512:
6
- metadata.gz: 76c8cb827b417c70a1a10a906a00edfbfb799c084939313d5ae01628990e39358483b7803f1bfcafc75fd82c75d9cddea87fa9e0128a23f55a90777079046f94
7
- data.tar.gz: 588a9e685a918947aa9e3735eff675427f4ba164445eecde49159cdd0c5de822214b1035fe155660808676d143abebc2bc27b25421376439553058c5f8f4ea2b
6
+ metadata.gz: 0420a044e314bb6aeaeed0dd58cef0549d6b51f87daa65849315d5d12a6dda96bff473cb1c3db6a93af813925de69d91a17b14fece0130131fa06c5cf86730a9
7
+ data.tar.gz: 773144d01f6966c29a9b42342b3106c36e3c8c3d858aabce7fe503ecbad2ef195bcb6c5711962d02f4990541678dfadead0025e2d385956fabb54a35cc4cd39a
@@ -1,4 +1,4 @@
1
- future-release=v1.0.17
1
+ future-release=v1.0.18
2
2
  since-tag=v0.9
3
3
  exclude_tags_regex=v0\.[0-8]\..*
4
4
  exclude-labels=nochangelog,question
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.0.18](https://github.com/DragonBox/u3d/tree/v1.0.18) (2018-03-08)
4
+ [Full Changelog](https://github.com/DragonBox/u3d/compare/v1.0.17...v1.0.18)
5
+
6
+ **Closed issues:**
7
+
8
+ - error: Net::ReadTimeout [\#258](https://github.com/DragonBox/u3d/issues/258)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - u3d/\* allow to modify Net::HTTP read timeout \(all rubies\) and max retries \(ruby 2.5+\) default values. Change read time out to 300 sec \(fixes \#258\) [\#260](https://github.com/DragonBox/u3d/pull/260) ([lacostej](https://github.com/lacostej))
13
+
3
14
  ## [v1.0.17](https://github.com/DragonBox/u3d/tree/v1.0.17) (2018-03-05)
4
15
  [Full Changelog](https://github.com/DragonBox/u3d/compare/v1.0.16...v1.0.17)
5
16
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- u3d (1.0.17)
4
+ u3d (1.0.18)
5
5
  colored (>= 1.2, < 2.0.0)
6
6
  commander (>= 4.4.0, < 5.0.0)
7
7
  file-tail (>= 1.2.0)
data/README.md CHANGED
@@ -191,3 +191,11 @@ Your version of OpenSSL may be be outdated, make sure you are using the last one
191
191
  * __On Windows:__
192
192
 
193
193
  A fix to the issue stated above has been found on [StackOverflow](http://stackoverflow.com/questions/5720484/how-to-solve-certificate-verify-failed-on-windows). If you follow the steps described in this topic, you will most likely get rid of this issue.
194
+
195
+ ### Solve Connection failures
196
+
197
+ If your network is flaky you might try to change the way u3d uses ruby's Net::HTTP trsnsport mechanism
198
+
199
+ * set U3D_HTTP_READ_TIMEOUT (defaults 300 seconds) to change the http read timeout
200
+
201
+ * U3D_HTTP_MAX_RETRIES (ruby 2.5 only, defaults 1). Ruby automatically retries once upon failures on idempotents methods. From ruby 2.5. you can change the number of time ruby might retry.
data/lib/u3d/utils.rb CHANGED
@@ -58,7 +58,7 @@ module U3d
58
58
  uri = URI(url)
59
59
  begin
60
60
  use_ssl = /^https/.match(url)
61
- Net::HTTP.start(uri.host, uri.port, use_ssl: use_ssl) do |http|
61
+ Net::HTTP.start(uri.host, uri.port, http_opts(use_ssl: use_ssl)) do |http|
62
62
  request = http_request_class http_method, uri
63
63
  request_headers.each do |k, v|
64
64
  request[k] = v
@@ -93,7 +93,7 @@ module U3d
93
93
  current = 0
94
94
  last_print_update = 0
95
95
  print_progress = UI.interactive? || U3dCore::Globals.verbose?
96
- Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
96
+ Net::HTTP.start(uri.host, uri.port, http_opts(use_ssl: uri.scheme == 'https')) do |http|
97
97
  request = Net::HTTP::Get.new uri
98
98
  http.request request do |response|
99
99
  begin
@@ -129,7 +129,7 @@ module U3d
129
129
  UI.verbose "get_url_content_length #{url}"
130
130
  uri = URI(url)
131
131
  size = nil
132
- Net::HTTP.start(uri.host, uri.port) do |http|
132
+ Net::HTTP.start(uri.host, uri.port, http_opts) do |http|
133
133
  response = http.request_head url
134
134
  size = Integer(response['Content-Length'])
135
135
  end
@@ -204,6 +204,26 @@ module U3d
204
204
  def windows_path(path)
205
205
  path.gsub(%r{\/(\d)}, '/\\\\\1').tr('/', '\\')
206
206
  end
207
+
208
+ private
209
+
210
+ def http_max_retries
211
+ ENV['U3D_HTTP_MAX_RETRIES'].to_i if ENV['U3D_HTTP_MAX_RETRIES']
212
+ end
213
+
214
+ def http_read_timeout
215
+ return ENV['U3D_HTTP_READ_TIMEOUT'].to_i if ENV['U3D_HTTP_READ_TIMEOUT']
216
+ 300
217
+ end
218
+
219
+ def http_opts(opt = {})
220
+ # the keys are #ca_file, #ca_path, cert, #cert_store, ciphers, #close_on_empty_response, key, #open_timeout,
221
+ # #read_timeout, #ssl_timeout, #ssl_version, use_ssl, #verify_callback, #verify_depth and verify_mode
222
+ opt[:max_retries] = http_max_retries if http_max_retries
223
+ opt[:read_timeout] = http_read_timeout if http_read_timeout
224
+ UI.verbose "Using http opts: #{opt}"
225
+ opt
226
+ end
207
227
  end
208
228
  end
209
229
  # rubocop:enable ModuleLength
data/lib/u3d/version.rb CHANGED
@@ -21,7 +21,7 @@
21
21
  ## --- END LICENSE BLOCK ---
22
22
 
23
23
  module U3d
24
- VERSION = '1.0.17'.freeze
24
+ VERSION = '1.0.18'.freeze
25
25
  DESCRIPTION = 'Provides numerous tools for installing, managing and running the Unity3D game engine from command line.'.freeze
26
26
  UNITY_VERSIONS_NOTE = "Unity3d uses the following version formatting: 0.0.0x0. The \'x\' can takes different values:\n"\
27
27
  "\t. 'f' are the main release candidates for Unity3d\n"\
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: u3d
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerome Lacoste
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-05 00:00:00.000000000 Z
12
+ date: 2018-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colored