Skip to content

Commit

Permalink
Merge pull request #553 from laumacirule/fix_uri_open
Browse files Browse the repository at this point in the history
#552 Use URI.open instead of open
  • Loading branch information
enebo authored Oct 8, 2024
2 parents 3756c6c + ae57843 commit 973d14c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/warbler/web_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def local_path
FileUtils.mkdir_p File.dirname(cached_path) #:nocov:
require 'open-uri' #:nocov:
begin
open(download_url) do |stream| #:nocov:
URI.open(download_url) do |stream| #:nocov:
File.open(cached_path, "wb") do |f| #:nocov:
while buf = stream.read(4096) #:nocov:
f << buf #:nocov:
Expand Down
8 changes: 5 additions & 3 deletions spec/warbler/web_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ def self.reset_local_repository

describe Warbler::WebServer::Artifact do

@@_env = ENV.to_h

after(:all) { ENV.clear; ENV.update @@_env }
before(:all) do
@_env = ENV.to_h
end

before do
Warbler::WebServer::Artifact.reset_local_repository
end

after(:all) do
Warbler::WebServer::Artifact.reset_local_repository
ENV.clear
ENV.update @_env
end

let(:sample_artifact) do
Expand Down

0 comments on commit 973d14c

Please sign in to comment.