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