Class: AbideDevUtils::Comply::ReportScraper
- Inherits:
-
Object
- Object
- AbideDevUtils::Comply::ReportScraper
- Defined in:
- lib/abide_dev_utils/comply.rb
Overview
Class that uses Selenium WebDriver to gather scan reports from Puppet Comply
Instance Attribute Summary collapse
-
#ignorelist ⇒ Object
readonly
Returns the value of attribute ignorelist.
-
#max_pagination ⇒ Object
readonly
Returns the value of attribute max_pagination.
-
#onlylist ⇒ Object
readonly
Returns the value of attribute onlylist.
-
#page_source_on_error ⇒ Object
readonly
Returns the value of attribute page_source_on_error.
-
#screenshot_on_error ⇒ Object
readonly
Returns the value of attribute screenshot_on_error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #build_report(password) ⇒ Object
- #file_dir ⇒ Object
- #file_dir=(path) ⇒ Object
-
#initialize(url, config = nil, **opts) ⇒ ReportScraper
constructor
A new instance of ReportScraper.
Constructor Details
#initialize(url, config = nil, **opts) ⇒ ReportScraper
Returns a new instance of ReportScraper.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/abide_dev_utils/comply.rb', line 60 def initialize(url, config = nil, **opts) @url = url @config = config @opts = opts @timeout = fetch_option(:timeout, 10).to_i @username = fetch_option(:username, 'comply') @status = fetch_option(:status) @ignorelist = fetch_option(:ignorelist, []) @onlylist = fetch_option(:onlylist, []) @max_pagination = fetch_option(:max_pagination, 5).to_i @screenshot_on_error = fetch_option(:screenshot_on_error, false) @page_source_on_error = fetch_option(:page_source_on_error, false) end |
Instance Attribute Details
#ignorelist ⇒ Object (readonly)
Returns the value of attribute ignorelist.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def ignorelist @ignorelist end |
#max_pagination ⇒ Object (readonly)
Returns the value of attribute max_pagination.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def max_pagination @max_pagination end |
#onlylist ⇒ Object (readonly)
Returns the value of attribute onlylist.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def onlylist @onlylist end |
#page_source_on_error ⇒ Object (readonly)
Returns the value of attribute page_source_on_error.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def page_source_on_error @page_source_on_error end |
#screenshot_on_error ⇒ Object (readonly)
Returns the value of attribute screenshot_on_error.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def screenshot_on_error @screenshot_on_error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def status @status end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def timeout @timeout end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
51 52 53 |
# File 'lib/abide_dev_utils/comply.rb', line 51 def username @username end |
Instance Method Details
#build_report(password) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/abide_dev_utils/comply.rb', line 74 def build_report(password) connect(password) scrape_report ensure driver.quit end |
#file_dir ⇒ Object
81 82 83 |
# File 'lib/abide_dev_utils/comply.rb', line 81 def file_dir @file_dir ||= File.('~/abide_dev_utils') end |
#file_dir=(path) ⇒ Object
85 86 87 |
# File 'lib/abide_dev_utils/comply.rb', line 85 def file_dir=(path) @file_dir = new_file_dir(path) end |