Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejas Bubane <tejasbubane@gmail.com>2020-05-17 20:12:24 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2020-05-18 21:17:58 +0300
commit146a87f588f50466f3dd908869d957809bc6c456 (patch)
treed870d5dba186f87fe10f6da453fff7020214bdf6
parented341427b4b97adc10873cbf93fc947b063623cc (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.rb4
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