Class: CMSScanner::Controller::Base
- Inherits:
-
Object
- Object
- CMSScanner::Controller::Base
show all
- Includes:
- OptParseValidator
- Defined in:
- lib/cms_scanner/controller.rb
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.parsed_options=(options) ⇒ Object
Set the parsed options and initialize the browser with them
29
30
31
32
33
|
# File 'lib/cms_scanner/controller.rb', line 29
def self.parsed_options=(options)
@@parsed_options = options
NS::Browser.instance(options)
end
|
Instance Method Details
#==(other) ⇒ Object
16
17
18
|
# File 'lib/cms_scanner/controller.rb', line 16
def ==(other)
self.class == other.class
end
|
#after_scan ⇒ Object
14
|
# File 'lib/cms_scanner/controller.rb', line 14
def after_scan; end
|
#before_scan ⇒ Object
10
|
# File 'lib/cms_scanner/controller.rb', line 10
def before_scan; end
|
#cli_options ⇒ Array<OptParseValidator::OptBase>
8
|
# File 'lib/cms_scanner/controller.rb', line 8
def cli_options; end
|
#datastore ⇒ Hash
41
42
43
|
# File 'lib/cms_scanner/controller.rb', line 41
def datastore
@@datastore ||= {}
end
|
46
47
48
|
# File 'lib/cms_scanner/controller.rb', line 46
def formatter
@@formatter ||= NS::Formatter.load(parsed_options[:format], datastore[:views])
end
|
#output(tpl, vars = {}) ⇒ Void
53
54
55
|
# File 'lib/cms_scanner/controller.rb', line 53
def output(tpl, vars = {})
formatter.output(*tpl_params(tpl, vars))
end
|
#parsed_options ⇒ Hash
36
37
38
|
# File 'lib/cms_scanner/controller.rb', line 36
def parsed_options
@@parsed_options ||= {}
end
|
#render(tpl, vars = {}) ⇒ String
60
61
62
|
# File 'lib/cms_scanner/controller.rb', line 60
def render(tpl, vars = {})
formatter.render(*tpl_params(tpl, vars))
end
|
#run ⇒ Object
12
|
# File 'lib/cms_scanner/controller.rb', line 12
def run; end
|
21
22
23
|
# File 'lib/cms_scanner/controller.rb', line 21
def target
@@target ||= NS::Target.new(parsed_options[:url], parsed_options)
end
|
#user_interaction? ⇒ Boolean
65
66
67
|
# File 'lib/cms_scanner/controller.rb', line 65
def user_interaction?
formatter.user_interaction? && !parsed_options[:output]
end
|