class Metasploit::Model::Spec::PathnameCollision
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.
Public Class Methods
check!(pathname)
click to toggle source
Checks if there is a pathname collision.
@param (see initialize) @return [void] @raise [Metasploit::Model::Spec::PathnameCollision] if `pathname.exist?` is `true`.
# File lib/metasploit/model/spec/pathname_collision.rb, line 9 def self.check!(pathname) if pathname.exist? raise new(pathname) end end
new(pathname)
click to toggle source
@param pathname [Pathname] Pathname that already exists on disk
Calls superclass method
# 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