Sha256: c7d1ca96850e6734772a95cfd303f83ff36399d14acdb0e9b4b9a63c91407155

Contents?: true

Size: 994 Bytes

Versions: 18

Compression:

Stored size: 994 Bytes

Contents

module Metasploit
  module Model
    module Spec
      # 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 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
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
metasploit-model-0.27.0.pre.dep.pre.railties lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.26.1-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.26.1 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.7 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.7-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.6 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.6-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.3 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.3-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.2 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.2-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.1 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.1-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.25.1.pre.metasploit.pre.model.pre.search.pre.operator.pre.and.pre.operation.pre.groups lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.24.1-java lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.24.1 lib/metasploit/model/spec/pathname_collision.rb
metasploit-model-0.24.1.pre.semantic.pre.versioning.pre.2.pre.0 lib/metasploit/model/spec/pathname_collision.rb