Exception: Metasploit::Model::Spec::PathnameCollision
- Defined in:
- lib/metasploit/model/spec/pathname_collision.rb
Overview
Error raised if a Pathname already exists on disk when one of the real_paths for metasploit-models factories is generated or derived, which would indicate that a prior spec did not clean up properly.
Class Method Summary collapse
-
.check!(pathname) ⇒ void
Checks if there is a pathname collision.
Instance Method Summary collapse
-
#initialize(pathname) ⇒ PathnameCollision
constructor
A new instance of PathnameCollision.
Constructor Details
#initialize(pathname) ⇒ PathnameCollision
Returns a new instance of PathnameCollision.
16 17 18 19 20 21 |
# File 'lib/metasploit/model/spec/pathname_collision.rb', line 16 def initialize(pathname) super( "#{pathname} already exists. " \ "Metasploit::Model::Spec.remove_temporary_pathname was not called after the previous spec." ) end |
Class Method Details
.check!(pathname) ⇒ void
This method returns an undefined value.
Checks if there is a pathname collision.
9 10 11 12 13 |
# File 'lib/metasploit/model/spec/pathname_collision.rb', line 9 def self.check!(pathname) if pathname.exist? raise new(pathname) end end |