bundlerEnv: better error handling
properly handle the case where a gemspec is missing
This commit is contained in:
parent
be3d3dd298
commit
7fc3b002e6
@ -74,16 +74,24 @@ Bundler::Fetcher.class_eval do
|
|||||||
|
|
||||||
spec_list = gem_names.map do |name|
|
spec_list = gem_names.map do |name|
|
||||||
spec = Bundler.nix_gemspecs.detect {|spec| spec.name == name }
|
spec = Bundler.nix_gemspecs.detect {|spec| spec.name == name }
|
||||||
dependencies = spec.dependencies.
|
if spec.nil?
|
||||||
select {|dep| dep.type != :development}.
|
msg = "WARNING: Could not find gemspec for '#{name}'"
|
||||||
map do |dep|
|
Bundler.ui.warn msg
|
||||||
deps_list << dep.name
|
nil
|
||||||
dep
|
else
|
||||||
end
|
dependencies = spec.dependencies.
|
||||||
|
select {|dep| dep.type != :development}.
|
||||||
|
map do |dep|
|
||||||
|
deps_list << dep.name
|
||||||
|
dep
|
||||||
|
end
|
||||||
|
|
||||||
[spec.name, spec.version, spec.platform, dependencies]
|
[spec.name, spec.version, spec.platform, dependencies]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
spec_list.compact!
|
||||||
|
|
||||||
[spec_list, deps_list.uniq]
|
[spec_list, deps_list.uniq]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user