Class: Dradis::Plugins::Projects::Upload::V4::Template::Importer
- Inherits:
-
Template::Importer
- Object
- Upload::Importer
- Template::Importer
- Dradis::Plugins::Projects::Upload::V4::Template::Importer
- Defined in:
- lib/dradis/plugins/projects/upload/v4/template.rb
Constant Summary collapse
- ATTACHMENT_URL =
%r{^!(/[a-z]+)?/(?:projects/\d+/)?nodes/(\d+)/attachments/(.+)!$}
Instance Attribute Summary collapse
-
#attachment_notes ⇒ Object
Returns the value of attribute attachment_notes.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#pending_changes ⇒ Object
Returns the value of attribute pending_changes.
-
#users ⇒ Object
writeonly
Sets the attribute users.
Attributes inherited from Template::Importer
#lookup_table, #template_version
Instance Method Summary collapse
Methods inherited from Template::Importer
Instance Attribute Details
#attachment_notes ⇒ Object
Returns the value of attribute attachment_notes.
5 6 7 |
# File 'lib/dradis/plugins/projects/upload/v4/template.rb', line 5 def @attachment_notes end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/dradis/plugins/projects/upload/v4/template.rb', line 5 def logger @logger end |
#pending_changes ⇒ Object
Returns the value of attribute pending_changes.
5 6 7 |
# File 'lib/dradis/plugins/projects/upload/v4/template.rb', line 5 def pending_changes @pending_changes end |
#users=(value) ⇒ Object
Sets the attribute users
5 6 7 |
# File 'lib/dradis/plugins/projects/upload/v4/template.rb', line 5 def users=(value) @users = value end |
Instance Method Details
#post_initialize(args = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/dradis/plugins/projects/upload/v4/template.rb', line 9 def post_initialize(args={}) @lookup_table = { categories: {}, nodes: {}, issues: {} } @pending_changes = { # If the note has an attachment screenshot (i.e. !.../nodes/i/attachments/...!) # we will fix the URL to point to the new Node ID. # # WARNING: we need a lookup table because one note may be referencing a # different (yet unprocessed) node's attachments. attachment_notes: [], # evidence is parsed when nodes are parsed, but cannot be saved until # issues have been created. Therefore, parse evidence into arrays until # time for creation evidence: [], # likewise we also need to hold on to the XML about evidence activities # and comments until after the evidence has been saved evidence_activity: [], evidence_comments: [], # all children nodes, we will need to find the ID of their new parents. orphan_nodes: [] } end |