ruby-nmap 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d68c401c750d115bbd1dbe2d660702749ca20444012e5ef9f06fae022d13029d
4
- data.tar.gz: 7909d00c750adbfddb72ede9e50e298d1c3a39803c8f9075bf174bb875d4ae5c
3
+ metadata.gz: 7e3189bf536d0b75455d40015a117eb26746aefbde6a6cccd605860be7fb8b6f
4
+ data.tar.gz: 303dcff7ac2ecb8f0a3e923ba9834e3044fd976be710a5f76d702e986827a640
5
5
  SHA512:
6
- metadata.gz: 746169835110421deadef68c804a225b6c7fc4a1b33436deadbf22013b8113ffc48c3edda145a9ff51c5f1d1cb782b4a174baa6b64cc673baa90cd354b44615b
7
- data.tar.gz: 42f3be8d68f03624920cd86d752bb525eb0ba66aebea2915a7ee516c2c5ce92b4abbd8a8cbc55072fa91c48b5e8455dcee1ef271324183bae44e44348e8b3f44
6
+ metadata.gz: 879272c70b52dc9b77abbb1990b4b48973d7a8f2e01b9a608ce9c3ce9a7c5240abeab1fc4bcdc4d30c59a8790b083f82a85a3254d962d0ccab0f7e4d2608c480
7
+ data.tar.gz: 709b91ce49dd96614de4441305a711cdb18fcb8185fffcc988f8c65ba9989785d65f69bf5e3dc05af7686ca26b0db43c90fb4710e86be44ddc20340042741507
@@ -9,14 +9,15 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  ruby:
12
- - '2.7'
13
12
  - '3.0'
14
13
  - '3.1'
14
+ - '3.2'
15
+ - '3.3'
15
16
  - jruby
16
17
  - truffleruby
17
18
  name: Ruby ${{ matrix.ruby }}
18
19
  steps:
19
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v4
20
21
  - name: Set up Ruby
21
22
  uses: ruby/setup-ruby@v1
22
23
  with:
data/ChangeLog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 1.0.3 / 2024-01-25
2
+
3
+ * Switched to using `require_relative` to improve load-times.
4
+ * Added `# frozen_string_literal: true` to all files.
5
+
6
+ #### Nmap::Command
7
+
8
+ * The `--mtu` option now accepts an option numeric value.
9
+
1
10
  ### 1.0.2 / 2023-09-01
2
11
 
3
12
  #### Nmap::Command
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2022 Postmodern
1
+ Copyright (c) 2009-2024 Hal Brodigan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -129,8 +129,6 @@ $ gem install ruby-nmap
129
129
 
130
130
  ## License
131
131
 
132
- Copyright (c) 2009-2022 Postmodern
133
-
134
132
  See {file:LICENSE.txt} for license information.
135
133
 
136
134
  [nmap]: http://www.insecure.org/
data/lib/nmap/command.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'command_mapper/command'
2
4
 
3
5
  module Nmap
@@ -734,7 +736,7 @@ module Nmap
734
736
 
735
737
  # FIREWALL/IDS EVASION AND SPOOFING:
736
738
  option '-f', name: :packet_fragments
737
- option '--mtu'
739
+ option '--mtu', value: {type: Num.new, required: false}
738
740
  option '-D', name: :decoys, value: {type: List.new}
739
741
  option '-S', name: :spoof, value: true
740
742
  option '-e', name: :interface, value: true
data/lib/nmap/version.rb CHANGED
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  # ruby-nmap version
3
- VERSION = '1.0.2'
5
+ VERSION = '1.0.3'
4
6
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  module CPE
data/lib/nmap/xml/cpe.rb CHANGED
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/cpe/url'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'cpe/url'
2
4
 
3
5
  module Nmap
4
6
  class XML
data/lib/nmap/xml/hop.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
data/lib/nmap/xml/host.rb CHANGED
@@ -1,14 +1,16 @@
1
- require 'nmap/xml/status'
2
- require 'nmap/xml/address'
3
- require 'nmap/xml/hostname'
4
- require 'nmap/xml/os'
5
- require 'nmap/xml/port'
6
- require 'nmap/xml/ip_id_sequence'
7
- require 'nmap/xml/tcp_sequence'
8
- require 'nmap/xml/tcp_ts_sequence'
9
- require 'nmap/xml/uptime'
10
- require 'nmap/xml/traceroute'
11
- require 'nmap/xml/host_script'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'status'
4
+ require_relative 'address'
5
+ require_relative 'hostname'
6
+ require_relative 'os'
7
+ require_relative 'port'
8
+ require_relative 'ip_id_sequence'
9
+ require_relative 'tcp_sequence'
10
+ require_relative 'tcp_ts_sequence'
11
+ require_relative 'uptime'
12
+ require_relative 'traceroute'
13
+ require_relative 'host_script'
12
14
 
13
15
  require 'nokogiri'
14
16
  require 'time'
@@ -258,7 +260,7 @@ module Nmap
258
260
  # @yield [uptime]
259
261
  # If a block is given, it will be passed the resulting object
260
262
  #
261
- # @yieldparam [Uptime]
263
+ # @yieldparam [Uptime]
262
264
  # Uptime value.
263
265
  #
264
266
  # @return [Uptime]
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/scripts'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'scripts'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/sequence'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'sequence'
2
4
 
3
5
  module Nmap
4
6
  class XML
data/lib/nmap/xml/os.rb CHANGED
@@ -1,5 +1,7 @@
1
- require 'nmap/xml/os_class'
2
- require 'nmap/xml/os_match'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'os_class'
4
+ require_relative 'os_match'
3
5
 
4
6
  module Nmap
5
7
  class XML
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/cpe'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'cpe'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
data/lib/nmap/xml/port.rb CHANGED
@@ -1,5 +1,7 @@
1
- require 'nmap/xml/service'
2
- require 'nmap/xml/scripts'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'service'
4
+ require_relative 'scripts'
3
5
 
4
6
  module Nmap
5
7
  class XML
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/scripts'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'scripts'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/scripts'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'scripts'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
data/lib/nmap/xml/scan.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/script'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'script'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -27,7 +29,6 @@ module Nmap
27
29
 
28
30
  return @scripts
29
31
  end
30
-
31
32
  end
32
33
  end
33
34
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -24,7 +26,7 @@ module Nmap
24
26
  #
25
27
  # @return [String]
26
28
  # The sequence class from nmap.
27
- #
29
+ #
28
30
  # @since 0.5.0
29
31
  #
30
32
  def description
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/cpe'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'cpe'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/sequence'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'sequence'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -14,7 +16,7 @@ module Nmap
14
16
  # The difficulty index from nmap
15
17
  #
16
18
  # @since 0.5.0
17
- #
19
+ #
18
20
  def index
19
21
  @index ||= if (index_string = @node['index'])
20
22
  index_string.to_i
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/sequence'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'sequence'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,4 +1,6 @@
1
- require 'nmap/xml/hop'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'hop'
2
4
 
3
5
  module Nmap
4
6
  class XML
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Nmap
2
4
  class XML
3
5
  #
data/lib/nmap/xml.rb CHANGED
@@ -1,10 +1,12 @@
1
- require 'nmap/xml/scanner'
2
- require 'nmap/xml/scan_task'
3
- require 'nmap/xml/scan'
4
- require 'nmap/xml/host'
5
- require 'nmap/xml/run_stat'
6
- require 'nmap/xml/prescript'
7
- require 'nmap/xml/postscript'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'xml/scanner'
4
+ require_relative 'xml/scan_task'
5
+ require_relative 'xml/scan'
6
+ require_relative 'xml/host'
7
+ require_relative 'xml/run_stat'
8
+ require_relative 'xml/prescript'
9
+ require_relative 'xml/postscript'
8
10
 
9
11
  require 'nokogiri'
10
12
 
data/lib/nmap.rb CHANGED
@@ -1,3 +1,5 @@
1
- require 'nmap/program'
2
- require 'nmap/xml'
3
- require 'nmap/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'nmap/program'
4
+ require_relative 'nmap/xml'
5
+ require_relative 'nmap/version'
data/ruby-nmap.gemspec CHANGED
@@ -7,10 +7,7 @@ Gem::Specification.new do |gem|
7
7
 
8
8
  gem.name = gemspec.fetch('name')
9
9
  gem.version = gemspec.fetch('version') do
10
- lib_dir = File.join(File.dirname(__FILE__),'lib')
11
- $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
12
-
13
- require 'nmap/version'
10
+ require_relative 'lib/nmap/version'
14
11
  Nmap::VERSION
15
12
  end
16
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-nmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-01 00:00:00.000000000 Z
11
+ date: 2024-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri