summaryrefslogtreecommitdiff
path: root/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb')
-rw-r--r--lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb b/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
index 074ee9dd7d..3fad948392 100644
--- a/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
+++ b/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
module Gem::Resolver::Molinillo
# An error that occurred during the resolution process
class ResolverError < StandardError; end
@@ -12,6 +12,7 @@ module Gem::Resolver::Molinillo
# @return [Array<Object>] the specifications that depended upon {#dependency}
attr_accessor :required_by
+ # Initializes a new error with the given missing dependency.
# @param [Object] dependency @see {#dependency}
# @param [Array<Object>] required_by @see {#required_by}
def initialize(dependency, required_by = [])
@@ -20,6 +21,8 @@ module Gem::Resolver::Molinillo
super()
end
+ # The error message for the missing dependency, including the specifications
+ # that had this dependency.
def message
sources = required_by.map { |r| "`#{r}`" }.join(' and ')
message = "Unable to find a specification for `#{dependency}`"
@@ -37,6 +40,7 @@ module Gem::Resolver::Molinillo
# [Set<Object>] the dependencies responsible for causing the error
attr_reader :dependencies
+ # Initializes a new error with the given circular vertices.
# @param [Array<DependencyGraph::Vertex>] nodes the nodes in the dependency
# that caused the error
def initialize(nodes)
@@ -51,6 +55,7 @@ module Gem::Resolver::Molinillo
# resolution to fail
attr_reader :conflicts
+ # Initializes a new error with the given version conflicts.
# @param [{String => Resolution::Conflict}] conflicts see {#conflicts}
def initialize(conflicts)
pairs = []