lib/sprockets/uri_tar.rb in sprockets-4.0.0.beta2 vs lib/sprockets/uri_tar.rb in sprockets-4.0.0.beta3
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
require 'sprockets/path_utils'
module Sprockets
# Internal: used to "expand" and "compress" values for storage
class URITar
@@ -12,13 +13,11 @@
def initialize(uri, env)
@root = env.root
@env = env
uri = uri.to_s
if uri.include?("://".freeze)
- uri_array = uri.split("://".freeze)
- @scheme = uri_array.shift
- @scheme << "://".freeze
- @path = uri_array.join("".freeze)
+ @scheme, _, @path = uri.partition("://".freeze)
+ @scheme << "://".freeze
else
@scheme = "".freeze
@path = uri
end
end