dradis-html_export 3.19.0 → 3.20.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: 5fcb7bc8d38264378015cd4c8e1685e44a7cd09e1253a01ef073fe9c27069cb7
4
- data.tar.gz: 1dd26e8483b3613c68148c0b0ad0707dafa925219ee4e32192096860a11fa42a
3
+ metadata.gz: 5f6ac583114b620b0f712eec9d0d4635012a0566e1b6b5bf6e331b708991c223
4
+ data.tar.gz: 571a3c231cddac14d08577f6811dd8beab715a0387fc763a99ce57b8340e9110
5
5
  SHA512:
6
- metadata.gz: 98d58bc1d770bf388e73946bbd76cda56ca9fec22f5f1505ff24c9ac8dd71005462ca7bc75fc5b0146402258f683680d32790b2e7f6524d5176bd1b9a81bb7e5
7
- data.tar.gz: a387b6edd7adab12deba1868970b03f9c7a02e2fa5f75cff7add7ad37c9bdf2b19f0a1e7cccd2560c3bb1feae1c02db20415b045b476efcab37d076db0ab3dc7
6
+ metadata.gz: 6700179c827068d2810787d028bdc0621f918e86588d7c666547e7ea00be5425e141b15740cab0b0afe359021f13e28e1300c4a03edd87e7e2b86cd0b6adb1b8
7
+ data.tar.gz: 36b73d54c2167cf49063882d9521e6954562331a3edc4464ec77b3f951302ad8ebc20ded1b9a7d996acc369e2000364ee916b0d2e6a5b1a2038d43ae6a7b1800
@@ -1,3 +1,8 @@
1
+ ## Dradis Framework 3.20 (December, 2020) ##
2
+
3
+ * Add an option in the exporter to pass a controller for rendering.
4
+ * Use NamingService to build export filename.
5
+
1
6
  ## Dradis Framework 3.19 (September, 2020) ##
2
7
 
3
8
  * No changes.
@@ -7,8 +7,10 @@ module Dradis
7
7
  def export(args = {})
8
8
  log_report
9
9
 
10
+ controller = args[:controller] || ApplicationController
11
+
10
12
  # Render template
11
- ApplicationController.render(
13
+ controller.render(
12
14
  file: options.fetch(:template),
13
15
  layout: false,
14
16
  locals: {
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 3
11
- MINOR = 19
11
+ MINOR = 20
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
@@ -15,9 +15,15 @@ class HtmlExportTasks < Thor
15
15
 
16
16
  report_path = options.output || Rails.root
17
17
  unless report_path.to_s =~ /\.html\z/
18
- date = DateTime.now.strftime("%Y-%m-%d")
19
- sequence = Dir.glob(File.join(report_path, "dradis-report_#{date}_*.html")).collect { |a| a.match(/_([0-9]+)\.html\z/)[1].to_i }.max || 0
20
- report_path = File.join(report_path, "dradis-report_#{date}_#{sequence + 1}.html")
18
+ date = DateTime.now.strftime("%Y-%m-%d")
19
+ base_filename = "dradis-report_#{date}.html"
20
+
21
+ report_filename = NamingService.name_file(
22
+ original_filename: base_filename,
23
+ pathname: Pathname.new(report_path)
24
+ )
25
+
26
+ report_path = File.join(report_path, report_filename)
21
27
  end
22
28
 
23
29
  if template = options.template
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.19.0
4
+ version: 3.20.0
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: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dradis-plugins
@@ -87,7 +87,7 @@ homepage: http://dradisframework.org
87
87
  licenses:
88
88
  - GPL-2
89
89
  metadata: {}
90
- post_install_message:
90
+ post_install_message:
91
91
  rdoc_options: []
92
92
  require_paths:
93
93
  - lib
@@ -102,8 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.0.1
106
- signing_key:
105
+ rubygems_version: 3.2.4
106
+ signing_key:
107
107
  specification_version: 4
108
108
  summary: Dradis HTML export plugin
109
109
  test_files: