Commit 04486e6 1 parent 2fd8e3c commit 04486e6 Copy full SHA for 04486e6
File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -64,12 +64,15 @@ def remove_dependencies_and_sources(dependency)
64
64
# This is used when an override has no options or a path is specified
65
65
# This path is turned into an absolute path
66
66
def expand_gem_path ( name , args , calling_file )
67
- args << { :path => name } if args . empty?
68
- return unless args . last . kind_of? ( Hash ) && args . last [ :path ]
67
+ return unless args . empty? || args . last . kind_of? ( Hash ) && ( args . last . empty? || args . last [ :path ] )
69
68
69
+ path = args . empty? ? name : args . last [ :path ]
70
70
possible_paths = [ File . dirname ( calling_file ) ] + bundler_inject_gem_path
71
- full_path = possible_paths . map { |p | File . expand_path ( args . last [ :path ] , p ) } . detect { |f | File . exist? ( f ) }
72
- args . last [ :path ] = full_path if full_path
71
+ full_path = possible_paths . map { |p | File . expand_path ( path , p ) } . detect { |f | File . exist? ( f ) }
72
+ if full_path
73
+ args << { } if args . empty?
74
+ args . last [ :path ] = full_path
75
+ end
73
76
end
74
77
75
78
def extract_version_opts ( args )
You can’t perform that action at this time.
0 commit comments