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
.option_parser=(parser) ⇒ Object
36
37
38
|
# File 'lib/cms_scanner/controller.rb', line 36
def self.option_parser=(parser)
@@option_parser = parser
end
|
.reset ⇒ Object
Reset all the class attibutes Currently only used in specs
24
25
26
27
28
|
# File 'lib/cms_scanner/controller.rb', line 24
def self.reset
@@target = nil
@@datastore = nil
@@formatter = nil
end
|
Instance Method Details
#==(other) ⇒ Object
18
19
20
|
# File 'lib/cms_scanner/controller.rb', line 18
def ==(other)
self.class == other.class
end
|
#after_scan ⇒ Object
16
|
# File 'lib/cms_scanner/controller.rb', line 16
def after_scan; end
|
#before_scan ⇒ Object
12
|
# File 'lib/cms_scanner/controller.rb', line 12
def before_scan; end
|
#cli_options ⇒ Array<OptParseValidator::OptBase>
10
|
# File 'lib/cms_scanner/controller.rb', line 10
def cli_options; end
|
#datastore ⇒ Hash
46
47
48
|
# File 'lib/cms_scanner/controller.rb', line 46
def datastore
@@datastore ||= {}
end
|
51
52
53
|
# File 'lib/cms_scanner/controller.rb', line 51
def formatter
@@formatter ||= NS::Formatter.load(NS::ParsedCli.format, datastore[:views])
end
|
#option_parser ⇒ OptParsevalidator::OptParser
41
42
43
|
# File 'lib/cms_scanner/controller.rb', line 41
def option_parser
@@option_parser
end
|
#output(tpl, vars = {}) ⇒ Void
58
59
60
|
# File 'lib/cms_scanner/controller.rb', line 58
def output(tpl, vars = {})
formatter.output(*tpl_params(tpl, vars))
end
|
#render(tpl, vars = {}) ⇒ String
65
66
67
|
# File 'lib/cms_scanner/controller.rb', line 65
def render(tpl, vars = {})
formatter.render(*tpl_params(tpl, vars))
end
|
#run ⇒ Object
14
|
# File 'lib/cms_scanner/controller.rb', line 14
def run; end
|
31
32
33
|
# File 'lib/cms_scanner/controller.rb', line 31
def target
@@target ||= NS::Target.new(NS::ParsedCli.url, NS::ParsedCli.options)
end
|
#tmp_directory ⇒ String
75
76
77
|
# File 'lib/cms_scanner/controller.rb', line 75
def tmp_directory
File.join('/tmp', NS.app_name)
end
|
#user_interaction? ⇒ Boolean
70
71
72
|
# File 'lib/cms_scanner/controller.rb', line 70
def user_interaction?
formatter.user_interaction? && !NS::ParsedCli.output
end
|