diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-23 21:02:56 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-23 21:02:56 +0900 |
commit | 31a6eaabc165d8a222e176f2c809d90622d88ec2 (patch) | |
tree | b5333db2c13888ede5062ccd8ecca649ea261b4c /lib/rubygems/exceptions.rb | |
parent | f56fc720ee8cd4b79824a1c3843058b662a302bd (diff) | |
download | ruby-31a6eaabc165d8a222e176f2c809d90622d88ec2.tar.gz |
Manually merged from https://github.com/rubygems/rubygems/pull/2636
Enable Style/EmptyLinesAroundClassBody rubocop cop.
Diffstat (limited to 'lib/rubygems/exceptions.rb')
-rw-r--r-- | lib/rubygems/exceptions.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/rubygems/exceptions.rb b/lib/rubygems/exceptions.rb index 804863f693..903abe0a6c 100644 --- a/lib/rubygems/exceptions.rb +++ b/lib/rubygems/exceptions.rb @@ -19,6 +19,7 @@ class Gem::DependencyRemovalException < Gem::Exception; end # and #conflicting_dependencies class Gem::DependencyResolutionError < Gem::DependencyError + attr_reader :conflict def initialize(conflict) @@ -31,20 +32,25 @@ class Gem::DependencyResolutionError < Gem::DependencyError def conflicting_dependencies @conflict.conflicting_dependencies end + end ## # Raised when attempting to uninstall a gem that isn't in GEM_HOME. class Gem::GemNotInHomeException < Gem::Exception + attr_accessor :spec + end ### # Raised when removing a gem with the uninstall command fails class Gem::UninstallError < Gem::Exception + attr_accessor :spec + end class Gem::DocumentError < Gem::Exception; end @@ -58,6 +64,7 @@ class Gem::EndOfYAMLException < Gem::Exception; end # operating on the given directory. class Gem::FilePermissionError < Gem::Exception + attr_reader :directory def initialize(directory) @@ -65,12 +72,15 @@ class Gem::FilePermissionError < Gem::Exception super "You don't have write permissions for the #{directory} directory." end + end ## # Used to raise parsing and loading errors class Gem::FormatException < Gem::Exception + attr_accessor :file_path + end class Gem::GemNotFoundException < Gem::Exception; end @@ -79,6 +89,7 @@ class Gem::GemNotFoundException < Gem::Exception; end # Raised by the DependencyInstaller when a specific gem cannot be found class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException + ## # Creates a new SpecificGemNotFoundException for a gem with the given +name+ # and +version+. Any +errors+ encountered when attempting to find the gem @@ -106,6 +117,7 @@ class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException # Errors encountered attempting to find the gem. attr_reader :errors + end ## @@ -113,6 +125,7 @@ end # inability to find a valid possible spec for a request. class Gem::ImpossibleDependenciesError < Gem::Exception + attr_reader :conflicts attr_reader :request @@ -140,14 +153,17 @@ class Gem::ImpossibleDependenciesError < Gem::Exception def dependency @request.dependency end + end class Gem::InstallError < Gem::Exception; end class Gem::RuntimeRequirementNotMetError < Gem::InstallError + attr_accessor :suggestion def message [suggestion, super].compact.join("\n\t") end + end ## @@ -189,6 +205,7 @@ class Gem::VerificationError < Gem::Exception; end # exit_code class Gem::SystemExitException < SystemExit + ## # The exit code for the process @@ -202,6 +219,7 @@ class Gem::SystemExitException < SystemExit super "Exiting RubyGems with exit_code #{exit_code}" end + end ## @@ -209,6 +227,7 @@ end # there is no spec. class Gem::UnsatisfiableDependencyError < Gem::DependencyError + ## # The unsatisfiable dependency. This is a # Gem::Resolver::DependencyRequest, not a Gem::Dependency @@ -253,6 +272,7 @@ class Gem::UnsatisfiableDependencyError < Gem::DependencyError def version @dependency.requirement end + end ## |