Class: Arachni::Reporters::HTML::TemplateScope

Inherits:
Object
  • Object
show all
Includes:
TemplateUtilities
Defined in:
components/reporters/html.rb

Constant Summary collapse

ISSUES_URL =
'https://github.com/Arachni/arachni/issues'

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TemplateUtilities

#base64_encode, #code_highlight, #data_dump, #erb, #escapeHTML, #highlight_issue_page_body, #highlight_proof, #id_to_location, #issue_id, #issue_location, #key_to_words, #md, #normalize

Constructor Details

#initialize(params = {}) ⇒ TemplateScope

Returns a new instance of TemplateScope.



304
305
306
307
# File 'components/reporters/html.rb', line 304

def initialize( params = {} )
    update params
    update self.class.global_data
end

Class Method Details

.global_dataObject



340
341
342
# File 'components/reporters/html.rb', line 340

def self.global_data
    @global_data
end

.global_data=(data) ⇒ Object



336
337
338
# File 'components/reporters/html.rb', line 336

def self.global_data=( data )
    @global_data = data
end

Instance Method Details

#[]=(name, value) ⇒ Object



314
315
316
317
318
# File 'components/reporters/html.rb', line 314

def []=( name, value )
    self.class.send( :attr_accessor, name )
    instance_variable_set( "@#{name.to_s}", value )
    self
end

#get_bindingObject



332
333
334
# File 'components/reporters/html.rb', line 332

def get_binding
    binding
end

#get_plugin_info(name) ⇒ Object



324
325
326
# File 'components/reporters/html.rb', line 324

def get_plugin_info( name )
    report.plugins[name.to_sym]
end

#js_multiline(str) ⇒ Object



328
329
330
# File 'components/reporters/html.rb', line 328

def js_multiline( str )
    "\"" + normalize( str ).gsub( "\n", '\n' ) + "\""
end

#prep_description(str) ⇒ Object



320
321
322
# File 'components/reporters/html.rb', line 320

def prep_description( str )
    escapeHTML Arachni::Reporters::HTML.prep_description( str )
end

#update(params) ⇒ Object



309
310
311
312
# File 'components/reporters/html.rb', line 309

def update( params )
    params.each { |name, value| self[name] = value }
    self
end