dradis-pdf_export 4.1.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/views/dradis/plugins/pdf_export/export/_index-content.html.erb +13 -0
- data/app/views/dradis/plugins/pdf_export/export/_index-tabs.html.erb +3 -0
- data/lib/dradis/plugins/pdf_export/gem_version.rb +1 -1
- data/lib/tasks/thorfile.rb +40 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2879fb069753eae8feab0b40d13d6662ca51d0cf274a1d7835652ca8b674769f
|
4
|
+
data.tar.gz: 5d8071ed543582ca07ff1fa1ff6dab5649749a410178317b57a40f07bbaa1d0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea041d5fcbf360fc4c49ef46ddfeee1df991f4398a78cf7810121d0c553ab4d099577ef822055ceba74dc15651fa879c4e09516572e7f5f46616a3cf680ddbc2
|
7
|
+
data.tar.gz: d4cbd80db62fde4175c82ddba76a4d873c12b587b0eb51986973d9f2977e73212411846fed35ede4926b1dbdea7a947e2fafe6094523f7970d15331832d53d98
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= content_tag :div, id: 'plugin-pdf_export', class: 'tab-pane fade' do %>
|
2
|
+
|
3
|
+
<h4>Generate a custom PDF report</h4>
|
4
|
+
|
5
|
+
To customize the PDF structure, see the <a href="https://dradisframework.com/support/guides/reporting/pdf_reports.html" target="_blank">Creating PDF reports</a> guide.
|
6
|
+
|
7
|
+
<%= form_tag project_export_manager_path(current_project), target: '_blank' do %>
|
8
|
+
<%= hidden_field_tag :plugin, :pdf_export %>
|
9
|
+
<%= hidden_field_tag :route, :root %>
|
10
|
+
|
11
|
+
<button id="export-button" class="btn btn-lg btn-primary mt-4">Export</button>
|
12
|
+
<% end %>
|
13
|
+
<% end%>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
class PdfExportTasks < Thor
|
2
|
+
include Rails.application.config.dradis.thor_helper_module
|
3
|
+
|
4
|
+
namespace 'dradis:plugins:pdf'
|
5
|
+
|
6
|
+
desc 'export', 'export the current repository structure as PDF document'
|
7
|
+
method_option :output, required: false, type: :string, desc: 'the report file to create (if ends in .pdf), or directory to create it in'
|
8
|
+
|
9
|
+
def export
|
10
|
+
require 'config/environment'
|
11
|
+
|
12
|
+
# The options we'll end up passing to the Processor class
|
13
|
+
opts = {}
|
14
|
+
|
15
|
+
report_path = options.output || Rails.root
|
16
|
+
unless report_path.to_s =~ /\.pdf\z/
|
17
|
+
date = DateTime.now.strftime('%Y-%m-%d')
|
18
|
+
base_filename = "dradis-report_#{date}.pdf"
|
19
|
+
|
20
|
+
report_filename = NamingService.name_file(
|
21
|
+
original_filename: base_filename,
|
22
|
+
pathname: Pathname.new(report_path)
|
23
|
+
)
|
24
|
+
|
25
|
+
report_path = File.join(report_path, report_filename)
|
26
|
+
end
|
27
|
+
|
28
|
+
detect_and_set_project_scope
|
29
|
+
|
30
|
+
exporter = Dradis::Plugins::PdfExport::Exporter.new(task_options)
|
31
|
+
pdf = exporter.export
|
32
|
+
|
33
|
+
File.open(report_path, 'wb') do |f|
|
34
|
+
f << pdf.render
|
35
|
+
end
|
36
|
+
|
37
|
+
logger.info{ "Report file created at:\n\t#{report_path}" }
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dradis-pdf_export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dradis-plugins
|
@@ -139,6 +139,8 @@ files:
|
|
139
139
|
- Rakefile
|
140
140
|
- app/assets/images/logo_pdf.jpg
|
141
141
|
- app/controllers/dradis/plugins/pdf_export/base_controller.rb
|
142
|
+
- app/views/dradis/plugins/pdf_export/export/_index-content.html.erb
|
143
|
+
- app/views/dradis/plugins/pdf_export/export/_index-tabs.html.erb
|
142
144
|
- config/routes.rb
|
143
145
|
- dradis-pdf_export.gemspec
|
144
146
|
- lib/dradis-pdf_export.rb
|
@@ -147,6 +149,7 @@ files:
|
|
147
149
|
- lib/dradis/plugins/pdf_export/exporter.rb
|
148
150
|
- lib/dradis/plugins/pdf_export/gem_version.rb
|
149
151
|
- lib/dradis/plugins/pdf_export/version.rb
|
152
|
+
- lib/tasks/thorfile.rb
|
150
153
|
homepage: http://dradisframework.org
|
151
154
|
licenses:
|
152
155
|
- GPL-2
|
@@ -166,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
169
|
- !ruby/object:Gem::Version
|
167
170
|
version: '0'
|
168
171
|
requirements: []
|
169
|
-
rubygems_version: 3.1.
|
172
|
+
rubygems_version: 3.1.4
|
170
173
|
signing_key:
|
171
174
|
specification_version: 4
|
172
175
|
summary: Dradis PDF export plugin
|