Skip to content

Commit

Permalink
Auto merge of tonsky#162 - koic:suppress_deprecation_warnings_in_prod…
Browse files Browse the repository at this point in the history
…uction_code, r=olleolleolle

Suppress deprecation warnings in production code

This PR suppresses the following Ruby warnings in production codes.

- ⚠️ `warning: URI.unescape is obsolete`
- ⚠️ `warning: URI.regexp is obsolete`
- ⚠️ `warning: instance variable @properties not initialized`
  • Loading branch information
bundlerbot committed Sep 4, 2017
2 parents 7d94d33 + 827a3a8 commit a0a7271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/gemstash/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def initialize(folder, name)
digest = Digest::MD5.hexdigest(@name)
child_folder = "#{safe_name}-#{digest}"
@folder = File.join(@base_path, *trie_parents, child_folder)
@properties = nil
end

# When +key+ is nil, this will test if this resource exists with any
Expand Down
4 changes: 2 additions & 2 deletions lib/gemstash/upstream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class Upstream
def_delegators :@uri, :scheme, :host, :user, :password, :to_s

def initialize(upstream, user_agent: nil)
@uri = URI(URI.decode(upstream.to_s))
@uri = URI(CGI.unescape(upstream.to_s))
@user_agent = user_agent
raise "URL '#{@uri}' is not valid!" unless @uri.to_s =~ URI.regexp
raise "URL '#{@uri}' is not valid!" unless @uri.to_s =~ URI::DEFAULT_PARSER.make_regexp
end

def url(path = nil, params = nil)
Expand Down

0 comments on commit a0a7271

Please sign in to comment.