dradis-html_export 3.20.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -43
- data/CHANGELOG.template +12 -0
- data/app/views/dradis/plugins/html_export/export/_index-content.html.erb +23 -0
- data/app/views/dradis/plugins/html_export/export/_index-tabs.html.erb +3 -0
- data/dradis-html_export.gemspec +1 -1
- data/lib/dradis/plugins/html_export/exporter.rb +32 -18
- data/lib/dradis/plugins/html_export/gem_version.rb +3 -3
- data/spec/fixtures/files/template.html.erb +12 -0
- data/spec/lib/dradis/plugins/html_export/exporter_spec.rb +25 -0
- metadata +15 -9
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 205222446aa051525b3f1a66c3de03860b2bcda28162666b170e156d6cf2d7da
|
4
|
+
data.tar.gz: e4ce08b1eb00b95a08371d710debab240efd7251f27859fc5dadf6abb2ac2e8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 327c889c0dc25383b6b7db55cd1b70bcfb9bd20131ec54560235c03c65af8394096ba62b75c4c06f4b46b7bed3e1397d201bb9d939d12984847ff5f4835c098e
|
7
|
+
data.tar.gz: eb430dfd5ad4428e95a6d5babae0068d0813c3323fe8ce59d3cdfe162d2c745116688c8ef68928a89a2bb6ce3b61886f03dc3c2c2b6b44ecbf0c8756c3e187a7
|
data/CHANGELOG.md
CHANGED
@@ -1,62 +1,64 @@
|
|
1
|
-
|
1
|
+
v4.1.1 (November 2021)
|
2
|
+
- Loosen dradis-plugins version requirement
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
v4.1.0 (November 2021)
|
5
|
+
- No changes
|
5
6
|
|
6
|
-
|
7
|
+
v4.0.0 (July 2021)
|
8
|
+
- No changes
|
7
9
|
|
8
|
-
|
10
|
+
v3.22.0 (April 2021)
|
11
|
+
- No changes
|
9
12
|
|
10
|
-
|
13
|
+
v3.21.0 (February 2021)
|
14
|
+
- Add a fix for Rails 6 not allowing HTML rendering outside the view directory
|
11
15
|
|
12
|
-
|
16
|
+
v3.20.0 (December 2020)
|
17
|
+
- Add an option in the exporter to pass a controller for rendering
|
18
|
+
- Add views for the export view
|
19
|
+
- Use NamingService to build export filename
|
13
20
|
|
14
|
-
|
21
|
+
v3.19.0 (September 2020)
|
22
|
+
- No changes
|
15
23
|
|
16
|
-
|
24
|
+
v3.18.0 (July 2020)
|
25
|
+
- No changes
|
17
26
|
|
18
|
-
|
27
|
+
v3.17.0 (May 2020)
|
28
|
+
- Render report using main app's ApplicationController#render
|
19
29
|
|
20
|
-
|
30
|
+
v3.16.0 (February 2020)
|
31
|
+
- No changes
|
21
32
|
|
22
|
-
|
33
|
+
v3.15.0 (November 2019)
|
34
|
+
- No changes
|
23
35
|
|
24
|
-
|
36
|
+
v3.14.0 (August 2019)
|
37
|
+
- No changes
|
25
38
|
|
39
|
+
v3.13.0 (June 2019)
|
40
|
+
- No changes
|
26
41
|
|
27
|
-
|
42
|
+
v3.12.0 (March 2019)
|
43
|
+
- No changes
|
28
44
|
|
29
|
-
|
45
|
+
v3.11.0 (November 2018)
|
46
|
+
- No changes
|
30
47
|
|
31
|
-
|
48
|
+
v3.10.0 (August 2018)
|
49
|
+
- Upgraded gems:
|
50
|
+
- RedCloth
|
51
|
+
- Bugs fixes:
|
52
|
+
- issue sorting
|
32
53
|
|
33
|
-
|
54
|
+
v3.9.0 (January 2018)
|
55
|
+
- Updated rendering html as in Rails 5.1 (`render html:`)
|
34
56
|
|
35
|
-
|
57
|
+
v3.8.0 (September 2017)
|
58
|
+
- No changes
|
36
59
|
|
37
|
-
|
60
|
+
v3.7.0 (July 2017)
|
61
|
+
- No changes
|
38
62
|
|
39
|
-
|
40
|
-
|
41
|
-
* No changes.
|
42
|
-
|
43
|
-
## Dradis Framework 3.10 (August, 2018) ##
|
44
|
-
|
45
|
-
* Security fix: update RedCloth to 4.3.2
|
46
|
-
* Fix issue sorting
|
47
|
-
|
48
|
-
## Dradis Framework 3.9 (January, 2018) ##
|
49
|
-
|
50
|
-
* Updated rendering html as in Rails 5.1 (`render html:`)
|
51
|
-
|
52
|
-
## Dradis Framework 3.8 (September, 2017) ##
|
53
|
-
|
54
|
-
* No changes.
|
55
|
-
|
56
|
-
## Dradis Framework 3.7 (July, 2017) ##
|
57
|
-
|
58
|
-
* No changes.
|
59
|
-
|
60
|
-
## Dradis Framework 3.6 (March, 2017) ##
|
61
|
-
|
62
|
-
* No changes.
|
63
|
+
v3.6.0 (March 2017)
|
64
|
+
- No changes
|
data/CHANGELOG.template
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
[v#.#.#] ([month] [YYYY])
|
2
|
+
- [future tense verb] [feature]
|
3
|
+
- Upgraded gems:
|
4
|
+
- [gem]
|
5
|
+
- Bugs fixes:
|
6
|
+
- [future tense verb] [bug fix]
|
7
|
+
- Bug tracker items:
|
8
|
+
- [item]
|
9
|
+
- Security Fixes:
|
10
|
+
- High: (Authenticated|Unauthenticated) (admin|author|contributor) [vulnerability description]
|
11
|
+
- Medium: (Authenticated|Unauthenticated) (admin|author|contributor) [vulnerability description]
|
12
|
+
- Low: (Authenticated|Unauthenticated) (admin|author|contributor) [vulnerability description]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%
|
2
|
+
templates_dir = File.join(::Configuration::paths_templates_reports, 'html_export')
|
3
|
+
templates = Dir["%s/*" % templates_dir].map { |t| File.basename(t) }.sort
|
4
|
+
%>
|
5
|
+
|
6
|
+
<%= content_tag :div, id: 'plugin-html_export', class: 'tab-pane fade' do %>
|
7
|
+
<%= form_tag project_export_manager_path(current_project), target: '_blank' do %>
|
8
|
+
<%= hidden_field_tag :plugin, :html_export %>
|
9
|
+
<%= hidden_field_tag :route, :root %>
|
10
|
+
|
11
|
+
<h4 class="header-underline">Choose a template</h4>
|
12
|
+
<p>Please choose one of the templates available for this plugin (find them in <code>.<%= templates_dir[Rails.root.to_s.length..-1] %></code>)</p>
|
13
|
+
|
14
|
+
<% templates.each do |template| %>
|
15
|
+
<div class="custom-control custom-radio">
|
16
|
+
<%= radio_button_tag :template, template, template == templates.first, :class => 'custom-control-input' %>
|
17
|
+
<label class="custom-control-label" for="template_<%= template %>"><%= template %></label>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<button id="export-button" class="btn btn-lg btn-primary mt-4">Export</button>
|
22
|
+
<% end %>
|
23
|
+
<% end%>
|
data/dradis-html_export.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
23
|
# gem.add_dependency 'dradis_core', version
|
24
|
-
spec.add_dependency 'dradis-plugins', '~>
|
24
|
+
spec.add_dependency 'dradis-plugins', '~> 4.0'
|
25
25
|
|
26
26
|
# Note markup
|
27
27
|
spec.add_dependency 'rails_autolink', '~> 1.1'
|
@@ -3,29 +3,30 @@ module Dradis
|
|
3
3
|
module HtmlExport
|
4
4
|
|
5
5
|
class Exporter < Dradis::Plugins::Export::Base
|
6
|
-
|
7
6
|
def export(args = {})
|
8
7
|
log_report
|
9
8
|
|
10
9
|
controller = args[:controller] || ApplicationController
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
11
|
+
with_temporary_template(options[:template]) do |temporary_template|
|
12
|
+
# Render template
|
13
|
+
controller.render(
|
14
|
+
template: temporary_template,
|
15
|
+
layout: false,
|
16
|
+
locals: {
|
17
|
+
categorized_issues: categorized_issues,
|
18
|
+
content_service: content_service,
|
19
|
+
issues: issues,
|
20
|
+
nodes: nodes,
|
21
|
+
notes: notes,
|
22
|
+
project: project,
|
23
|
+
reporting_cat: content_service.report_category,
|
24
|
+
tags: tags,
|
25
|
+
title: title,
|
26
|
+
user: options[:user]
|
27
|
+
}
|
28
|
+
)
|
29
|
+
end
|
29
30
|
end
|
30
31
|
|
31
32
|
private
|
@@ -94,6 +95,19 @@ module Dradis
|
|
94
95
|
"Dradis Community Edition v#{Dradis::CE.version}"
|
95
96
|
end
|
96
97
|
end
|
98
|
+
|
99
|
+
def with_temporary_template(original, &block)
|
100
|
+
filename = File.basename(Dir::Tmpname.create(['', '.html.erb']) {})
|
101
|
+
destination_path = Rails.root.join('app', 'views', 'tmp', filename)
|
102
|
+
|
103
|
+
FileUtils.mkdir_p(File.dirname(destination_path))
|
104
|
+
FileUtils.cp(original, destination_path)
|
105
|
+
|
106
|
+
yield("tmp/#{filename}")
|
107
|
+
ensure
|
108
|
+
file_path = Rails.root.join("app/views/tmp/#{filename}")
|
109
|
+
File.delete(file_path) if File.exists?(file_path)
|
110
|
+
end
|
97
111
|
end
|
98
112
|
end
|
99
113
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe Dradis::Plugins::HtmlExport::Exporter do
|
4
|
+
let!(:project) { create(:project) }
|
5
|
+
let!(:issues) { create_list(:issue, 3, node: project.issue_library) }
|
6
|
+
|
7
|
+
let(:export_options) do
|
8
|
+
{
|
9
|
+
project_id: project.id,
|
10
|
+
template: Dradis::Plugins::HtmlExport::Engine.root.join(
|
11
|
+
'spec/fixtures/files/template.html.erb'
|
12
|
+
)
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:exporter) { described_class.new(export_options) }
|
17
|
+
|
18
|
+
it 'exports html' do
|
19
|
+
html = exporter.export
|
20
|
+
|
21
|
+
issues.each do |issue|
|
22
|
+
expect(html.include?(issue.title))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dradis-html_export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Martin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dradis-plugins
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails_autolink
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,13 +63,15 @@ files:
|
|
63
63
|
- ".github/pull_request_template.md"
|
64
64
|
- ".gitignore"
|
65
65
|
- ".rspec"
|
66
|
-
- ".travis.yml"
|
67
66
|
- CHANGELOG.md
|
67
|
+
- CHANGELOG.template
|
68
68
|
- CONTRIBUTING.md
|
69
69
|
- Gemfile
|
70
70
|
- README.md
|
71
71
|
- Rakefile
|
72
72
|
- app/controllers/dradis/plugins/html_export/base_controller.rb
|
73
|
+
- app/views/dradis/plugins/html_export/export/_index-content.html.erb
|
74
|
+
- app/views/dradis/plugins/html_export/export/_index-tabs.html.erb
|
73
75
|
- config/routes.rb
|
74
76
|
- dradis-html_export.gemspec
|
75
77
|
- lib/dradis-html_export.rb
|
@@ -79,6 +81,8 @@ files:
|
|
79
81
|
- lib/dradis/plugins/html_export/gem_version.rb
|
80
82
|
- lib/dradis/plugins/html_export/version.rb
|
81
83
|
- lib/tasks/thorfile.rb
|
84
|
+
- spec/fixtures/files/template.html.erb
|
85
|
+
- spec/lib/dradis/plugins/html_export/exporter_spec.rb
|
82
86
|
- spec/requests/html_export_spec.rb
|
83
87
|
- spec/spec_helper.rb
|
84
88
|
- templates/basic.html.erb
|
@@ -87,7 +91,7 @@ homepage: http://dradisframework.org
|
|
87
91
|
licenses:
|
88
92
|
- GPL-2
|
89
93
|
metadata: {}
|
90
|
-
post_install_message:
|
94
|
+
post_install_message:
|
91
95
|
rdoc_options: []
|
92
96
|
require_paths:
|
93
97
|
- lib
|
@@ -102,10 +106,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
106
|
- !ruby/object:Gem::Version
|
103
107
|
version: '0'
|
104
108
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
106
|
-
signing_key:
|
109
|
+
rubygems_version: 3.1.6
|
110
|
+
signing_key:
|
107
111
|
specification_version: 4
|
108
112
|
summary: Dradis HTML export plugin
|
109
113
|
test_files:
|
114
|
+
- spec/fixtures/files/template.html.erb
|
115
|
+
- spec/lib/dradis/plugins/html_export/exporter_spec.rb
|
110
116
|
- spec/requests/html_export_spec.rb
|
111
117
|
- spec/spec_helper.rb
|