Class: X509Sleuth::Scanner
- Inherits:
-
Object
- Object
- X509Sleuth::Scanner
- Defined in:
- lib/x509_sleuth/scanner.rb,
lib/x509_sleuth/scanner/target.rb
Defined Under Namespace
Classes: Target
Instance Attribute Summary collapse
-
#clients ⇒ Object
readonly
Returns the value of attribute clients.
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
- #add_target(target_string) ⇒ Object
-
#initialize(options = {}) ⇒ Scanner
constructor
A new instance of Scanner.
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Scanner
Returns a new instance of Scanner.
9 10 11 12 13 14 15 16 |
# File 'lib/x509_sleuth/scanner.rb', line 9 def initialize( = {}) = { concurrency: 5 }.merge() @concurrency = [:concurrency] @targets = [] end |
Instance Attribute Details
#clients ⇒ Object (readonly)
Returns the value of attribute clients.
7 8 9 |
# File 'lib/x509_sleuth/scanner.rb', line 7 def clients @clients end |
#concurrency ⇒ Object
Returns the value of attribute concurrency.
6 7 8 |
# File 'lib/x509_sleuth/scanner.rb', line 6 def concurrency @concurrency end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
7 8 9 |
# File 'lib/x509_sleuth/scanner.rb', line 7 def targets @targets end |
Instance Method Details
#add_target(target_string) ⇒ Object
18 19 20 |
# File 'lib/x509_sleuth/scanner.rb', line 18 def add_target(target_string) @targets << X509Sleuth::Scanner::Target.new(target_string) end |
#run ⇒ Object
31 32 33 34 35 |
# File 'lib/x509_sleuth/scanner.rb', line 31 def run Parallel.each(clients, in_threads: concurrency) do |client| client.connect end end |