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.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/abide_dev_utils/comply.rb', line 58 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.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def ignorelist @ignorelist end |
#max_pagination ⇒ Object (readonly)
Returns the value of attribute max_pagination.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def max_pagination @max_pagination end |
#onlylist ⇒ Object (readonly)
Returns the value of attribute onlylist.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def onlylist @onlylist end |
#page_source_on_error ⇒ Object (readonly)
Returns the value of attribute page_source_on_error.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def page_source_on_error @page_source_on_error end |
#screenshot_on_error ⇒ Object (readonly)
Returns the value of attribute screenshot_on_error.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def screenshot_on_error @screenshot_on_error end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def status @status end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def timeout @timeout end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
49 50 51 |
# File 'lib/abide_dev_utils/comply.rb', line 49 def username @username end |
Instance Method Details
#build_report(password) ⇒ Object
72 73 74 75 76 77 |
# File 'lib/abide_dev_utils/comply.rb', line 72 def build_report(password) connect(password) scrape_report ensure driver.quit end |
#file_dir ⇒ Object
79 80 81 |
# File 'lib/abide_dev_utils/comply.rb', line 79 def file_dir @file_dir ||= File.('~/abide_dev_utils') end |
#file_dir=(path) ⇒ Object
83 84 85 |
# File 'lib/abide_dev_utils/comply.rb', line 83 def file_dir=(path) @file_dir = new_file_dir(path) end |