dradis-pdf_export 4.1.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -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: 883f88b39d4b35e48452efb3177311985ff3bf8a2710c540b316e28c3c5756f6
         | 
| 4 | 
            +
              data.tar.gz: 8d56ef39c026ceeae3ded0e1b7fd099e836f2521627c324d996646e484e575e6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 51bc73f7daf886e5c4ffe853965b44baaf87a94c047099556ec295355f3238868868c584639d3987b9260a83157a00c8ce8d59ca7c38ecd5c7fda3ce1ae1c7bc
         | 
| 7 | 
            +
              data.tar.gz: 5b2dfefec42de7a8acce4564cf29b11e8b543ae58cdf13584c3ef8e3a254e7423912cb66069d6b648749197aaf5689cfa9d8ec501654531d5785dde8fbb480ab
         | 
    
        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.4.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-06-13 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. | 
| 172 | 
            +
            rubygems_version: 3.2.32
         | 
| 170 173 | 
             
            signing_key: 
         | 
| 171 174 | 
             
            specification_version: 4
         | 
| 172 175 | 
             
            summary: Dradis PDF export plugin
         |