dradis-html_export 3.3.4 → 3.6.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 +3 -0
- data/README.md +5 -0
- data/app/controllers/dradis/plugins/html_export/base_controller.rb +3 -11
- data/dradis-html_export.gemspec +1 -1
- data/lib/dradis/plugins/html_export/engine.rb +0 -12
- data/lib/dradis/plugins/html_export/exporter.rb +2 -2
- data/lib/dradis/plugins/html_export/gem_version.rb +2 -2
- data/lib/tasks/thorfile.rb +7 -12
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bd63e4e5e10a84f073e39bb6783ba0a74745a49
|
4
|
+
data.tar.gz: d6b8d955487b127c791cc1ffed1ea3a6067c59af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4fb479e4726cec3519e28043418347106ffe3fe95140719345321a33f20a9bda04cc47df4f859a303d11e35ab1a4ea0872eda40d8830ab6697c5bc0f82594b5
|
7
|
+
data.tar.gz: 10809d2374965d7927dd8c8bdf8c82819114a530a8a2b7f102cf0aa1573d4b489e795271d127a0c5953515e68722620c3f00b98bd66f7691339f53a7962f1e43
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -21,3 +21,8 @@ See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisfra
|
|
21
21
|
## License
|
22
22
|
|
23
23
|
Dradis Framework and all its components are released under [GNU General Public License version 2.0](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.
|
24
|
+
|
25
|
+
|
26
|
+
## Feature requests and bugs
|
27
|
+
|
28
|
+
Please use the [Dradis Framework issue tracker](https://github.com/dradis/dradis-ce/issues) for add-on improvements and bug reports.
|
@@ -7,18 +7,10 @@ module Dradis
|
|
7
7
|
#
|
8
8
|
# It uses the template at: ./vendor/plugins/html_export/template.html.erb
|
9
9
|
def index
|
10
|
+
exporter = Dradis::Plugins::HtmlExport::Exporter.new(export_options)
|
11
|
+
html = exporter.export
|
10
12
|
|
11
|
-
|
12
|
-
export_manager_hash = session[:export_manager].with_indifferent_access
|
13
|
-
content_service_class = export_manager_hash[:content_service].constantize
|
14
|
-
|
15
|
-
exporter = Dradis::Plugins::HtmlExport::Exporter.new(
|
16
|
-
content_service: content_service_class.new(plugin: Dradis::Plugins::HtmlExport)
|
17
|
-
)
|
18
|
-
|
19
|
-
doc = exporter.export(export_manager_hash)
|
20
|
-
|
21
|
-
render type: 'text/html', text: doc
|
13
|
+
render type: 'text/html', text: html
|
22
14
|
end
|
23
15
|
end
|
24
16
|
|
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', '~> 3.
|
24
|
+
spec.add_dependency 'dradis-plugins', '~> 3.6'
|
25
25
|
|
26
26
|
# Note markup
|
27
27
|
spec.add_dependency 'rails_autolink', '~> 1.1'
|
@@ -25,18 +25,6 @@ module Dradis
|
|
25
25
|
mount Dradis::Plugins::HtmlExport::Engine => '/export/html'
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
29
|
-
# # TODO: could we use this instead?
|
30
|
-
# # https://github.com/spree/spree_analytics/blob/079949fd0e6d9ec87eefd8e3b9c70b5aa3bf25d3/lib/spree_analytics/engine.rb
|
31
|
-
# # Configuration
|
32
|
-
# # mattr_accessor :app_id, :site_id, :token, :api_url, :data_url
|
33
|
-
# # self.template = ''
|
34
|
-
# class Configuration < Dradis::Core::Configurator
|
35
|
-
# configure :namespace => 'htmlexport'
|
36
|
-
# setting :category, :default => 'HtmlExport ready'
|
37
|
-
# # setting :template, :default => Rails.root.join( 'vendor', 'plugins', 'html_export', 'template.html.erb' )
|
38
|
-
# setting :template, :default => '/Users/etd/dradis/git/dradis-html_export/template.html.erb'
|
39
|
-
# end
|
40
28
|
end
|
41
29
|
end
|
42
30
|
end
|
@@ -9,9 +9,8 @@ module Dradis
|
|
9
9
|
include ::ActionView::Helpers::UrlHelper
|
10
10
|
|
11
11
|
def export(args = {})
|
12
|
-
template_path =
|
12
|
+
template_path = options.fetch(:template)
|
13
13
|
template_properties = ::ReportTemplateProperties.find_by_template_file(File.basename(template_path)) rescue nil
|
14
|
-
project = args.key?(:project_id) ? Project.find_by_id(args[:project_id]) : nil
|
15
14
|
|
16
15
|
# Build title
|
17
16
|
title = if Dradis.constants.include?(:Pro)
|
@@ -22,6 +21,7 @@ module Dradis
|
|
22
21
|
logger.debug{ "Report title: #{title}"}
|
23
22
|
|
24
23
|
# Prepare notes
|
24
|
+
reporting_cat = content_service.report_category
|
25
25
|
notes = content_service.all_notes
|
26
26
|
logger.debug{ "Found #{notes.count} notes assigned to the reporting category."}
|
27
27
|
|
data/lib/tasks/thorfile.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class HtmlExportTasks < Thor
|
2
|
-
include
|
2
|
+
include Rails.application.config.dradis.thor_helper_module
|
3
3
|
|
4
4
|
namespace "dradis:plugins:html"
|
5
5
|
|
@@ -13,11 +13,10 @@ class HtmlExportTasks < Thor
|
|
13
13
|
# The options we'll end up passing to the Processor class
|
14
14
|
opts = {}
|
15
15
|
|
16
|
-
STDOUT.sync
|
17
|
-
logger
|
18
|
-
logger.level
|
16
|
+
STDOUT.sync = true
|
17
|
+
logger = Logger.new(STDOUT)
|
18
|
+
logger.level = Logger::DEBUG
|
19
19
|
opts[:logger] = logger
|
20
|
-
content_service = nil
|
21
20
|
|
22
21
|
report_path = options.output || Rails.root
|
23
22
|
unless report_path.to_s =~ /\.html\z/
|
@@ -26,26 +25,22 @@ class HtmlExportTasks < Thor
|
|
26
25
|
report_path = File.join(report_path, "dradis-report_#{date}_#{sequence + 1}.html")
|
27
26
|
end
|
28
27
|
|
29
|
-
|
30
28
|
if template = options.template
|
31
29
|
shell.error("Template file doesn't exist") && exit(1) unless File.exists?(template)
|
32
30
|
opts[:template] = template
|
33
31
|
end
|
34
32
|
|
35
33
|
detect_and_set_project_scope
|
36
|
-
exporter = Dradis::Plugins::HtmlExport::Exporter.new(
|
37
|
-
content_service: Dradis::Plugins::ContentService.new(plugin: Dradis::Plugins::HtmlExport)
|
38
|
-
)
|
39
34
|
|
40
|
-
|
35
|
+
exporter = Dradis::Plugins::HtmlExport::Exporter.new(opts)
|
36
|
+
html = exporter.export
|
41
37
|
|
42
38
|
File.open(report_path, 'w') do |f|
|
43
|
-
f <<
|
39
|
+
f << html
|
44
40
|
end
|
45
41
|
|
46
42
|
logger.info{ "Report file created at:\n\t#{report_path}" }
|
47
43
|
logger.close
|
48
44
|
end
|
49
45
|
|
50
|
-
|
51
46
|
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: 3.
|
4
|
+
version: 3.6.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: 2017-04-06 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: '3.
|
19
|
+
version: '3.6'
|
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: '3.
|
26
|
+
version: '3.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails_autolink
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- ".gitignore"
|
63
63
|
- ".rspec"
|
64
64
|
- ".travis.yml"
|
65
|
+
- CHANGELOG.md
|
65
66
|
- CONTRIBUTING.md
|
66
67
|
- Gemfile
|
67
68
|
- README.md
|
@@ -100,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
101
|
version: '0'
|
101
102
|
requirements: []
|
102
103
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.4.5
|
104
105
|
signing_key:
|
105
106
|
specification_version: 4
|
106
107
|
summary: Dradis HTML export plugin
|