diff options
author | Tejas Bubane <tejasbubane@gmail.com> | 2020-05-17 20:12:24 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2020-05-18 21:17:58 +0300 |
commit | 146a87f588f50466f3dd908869d957809bc6c456 (patch) | |
tree | d870d5dba186f87fe10f6da453fff7020214bdf6 | |
parent | ed341427b4b97adc10873cbf93fc947b063623cc (diff) |
Use URI.open instead of deprecated open
Got multiple errors while running rake update on ruby 2.7.1
```
/opensource/bootstrap-rubygem/tasks/updater/network.rb:28: warning:
calling URI.open via Kernel#open is deprecated, call URI.open directly
or use URI#open
```
```
/opensource/bootstrap-rubygem/tasks/updater/network.rb:65: warning:
calling URI.open via Kernel#open is deprecated, call URI.open directly
or use URI#open
```
-rw-r--r-- | tasks/updater/network.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tasks/updater/network.rb b/tasks/updater/network.rb index 7799f95..6502bb8 100644 --- a/tasks/updater/network.rb +++ b/tasks/updater/network.rb @@ -25,7 +25,7 @@ class Updater log_http_get_files files, path_url, false files.map do |name| Thread.start { - contents[name] = open("#{path_url}/#{name}").read + contents[name] = URI.open("#{path_url}/#{name}").read WRITE_FILES_MUTEX.synchronize { write_cached_files path, name => contents[name] } } end.each(&:join) @@ -62,7 +62,7 @@ class Updater File.read(cache_path, mode: 'rb') else log_http_get_file url, false - content = open(url).read + content = URI.open(url).read File.open(cache_path, 'wb') { |f| f.write content } content end |