Sha256: c28c718cd0aeb7c458005b4fdaff2f250f1aa8ded09cede45607050e7ec525a1

Contents?: true

Size: 680 Bytes

Versions: 1

Compression:

Stored size: 680 Bytes

Contents

module Nmapr

  module Builders
    module Command

      def to_cmd(type = :normal)
        if @ports.empty?
          ports = ""
        else
          ports = " -p " << @ports.join(",")
        end
        case type
        when :split
          @targets.each do |target|
            next if @not_targets.include?(target)
            "nmap " << target << @arguments
          end
        when :normal
          if @not_targets.empty?
            "nmap " << @targets.join(",") << ports << @arguments
          else
            "nmap " << @targets.join(",") << ports << @arguments << " --exclude " << @not_targets.join(",")
          end
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nmapr-1.0.0 lib/nmapr/builders/command.rb