Class: Dradis::Plugins::Projects::Upload::V1::Template::Importer
- Inherits:
-
Template::Importer
- Object
- Upload::Importer
- Template::Importer
- Dradis::Plugins::Projects::Upload::V1::Template::Importer
- Defined in:
- lib/dradis/plugins/projects/upload/v1/template.rb
Direct Known Subclasses
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.
14 15 16 |
# File 'lib/dradis/plugins/projects/upload/v1/template.rb', line 14 def @attachment_notes end |
#logger ⇒ Object
Returns the value of attribute logger.
14 15 16 |
# File 'lib/dradis/plugins/projects/upload/v1/template.rb', line 14 def logger @logger end |
#pending_changes ⇒ Object
Returns the value of attribute pending_changes.
14 15 16 |
# File 'lib/dradis/plugins/projects/upload/v1/template.rb', line 14 def pending_changes @pending_changes end |
#users=(value) ⇒ Object
Sets the attribute users
14 15 16 |
# File 'lib/dradis/plugins/projects/upload/v1/template.rb', line 14 def users=(value) @users = value end |
Instance Method Details
#post_initialize(args = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dradis/plugins/projects/upload/v1/template.rb', line 18 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 |