Sha256: 53458f50eec25df11af094fdd618b6c0087aca48e337fe00bb1156a91daa7ab5

Contents?: true

Size: 833 Bytes

Versions: 42

Compression:

Stored size: 833 Bytes

Contents

# 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 Metasploit::Model::Spec::PathnameCollision < Metasploit::Model::Spec::Error
  # Checks if there is a pathname collision.
  #
  # @param (see #initialize)
  # @return [void]
  # @raise [Metasploit::Model::Spec::PathnameCollision] if `pathname.exist?` is `true`.
  def self.check!(pathname)
    if pathname.exist?
      raise new(pathname)
    end
  end

  # @param pathname [Pathname] Pathname that already exists on disk
  def initialize(pathname)
    super(
        "#{pathname} already exists.  " \
              "Metasploit::Model::Spec.remove_temporary_pathname was not called after the previous spec."
    )
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
metasploit-model-5.0.2 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-5.0.1 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-5.0.0 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.6 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.5 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.4 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.3 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.2 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.1 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-4.0.0 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-3.1.4 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-3.1.3 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-3.1.2 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-3.1.1 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-3.1.0 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-3.0.0 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-2.0.4 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-2.0.3 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-2.0.2 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-2.0.1 lib/metasploit/model/spec/pathname_collision.rb