We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f193b06 commit 7f3d740Copy full SHA for 7f3d740
1 file changed
Gemfile
@@ -1,10 +1,19 @@
1
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
3
+require 'uri'
4
+
5
def location_for(place)
6
if place =~ /^((?:git[:@]|https:)[^#]*)#(.*)/
7
[{ :git => $1, :branch => $2, :require => false }]
- elsif place =~ /^file:\/\/(.*)/
- ['>= 0', { :path => File.expand_path($1), :require => false }]
8
+ elsif place.start_with?('file://')
9
+ uri = URI(place)
10
+ path =
11
+ if uri.host && !uri.host.empty?
12
+ "#{uri.host}#{uri.path}"
13
+ else
14
+ uri.path
15
+ end
16
+ ['>= 0', { path: path, require: false }]
17
else
18
[place, { :require => false }]
19
end
0 commit comments