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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b4fe7c789940f102135b59c9bac0ec1750250ccd1e8ae4f43ef511a88da2c24
4
- data.tar.gz: 4d21172050f7db481935f411c159e6cddaef2e3bda5c5827a76ee10080bba7c8
3
+ metadata.gz: 2879fb069753eae8feab0b40d13d6662ca51d0cf274a1d7835652ca8b674769f
4
+ data.tar.gz: 5d8071ed543582ca07ff1fa1ff6dab5649749a410178317b57a40f07bbaa1d0f
5
5
  SHA512:
6
- metadata.gz: 68854d55c5b6c746dd7a1bc5f1e35ef5ba9dfbf2d775e7dfd5e28cec29e7e9985d277130b9164c4b7f5a4e1539f4f396754a7dad87f019fe80ddadfeb5aa8f12
7
- data.tar.gz: f8a4e5a79538ed2bb548c1218784e70e95404f1aa9c5c1f6750f59e4e8196d4947de6785a7053dd7003399174f15509b690c6500f1434dc8bceaaa1ec38f1dce
6
+ metadata.gz: ea041d5fcbf360fc4c49ef46ddfeee1df991f4398a78cf7810121d0c553ab4d099577ef822055ceba74dc15651fa879c4e09516572e7f5f46616a3cf680ddbc2
7
+ data.tar.gz: d4cbd80db62fde4175c82ddba76a4d873c12b587b0eb51986973d9f2977e73212411846fed35ede4926b1dbdea7a947e2fafe6094523f7970d15331832d53d98
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ v4.2.0 (February 2022)
2
+ - Add Thor task for console export.
3
+ - Add view hook for Export#index
4
+
1
5
  v4.1.0 (November 2021)
2
6
  - No changes
3
7
 
@@ -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,3 @@
1
+ <li class='nav-item'>
2
+ <a href='#pdf_export' class='nav-link' data-toggle='tab' data-target='#plugin-pdf_export'><i class="fa fa-file-pdf-o"></i> Custom PDF reports</a>
3
+ </li>
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 4
11
- MINOR = 1
11
+ MINOR = 2
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -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.1.0
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: 2021-12-02 00:00:00.000000000 Z
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.6
172
+ rubygems_version: 3.1.4
170
173
  signing_key:
171
174
  specification_version: 4
172
175
  summary: Dradis PDF export plugin