dradis-csv_export 4.19.0 → 5.0.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 +3 -0
- data/lib/dradis/plugins/csv_export/gem_version.rb +2 -2
- data/lib/tasks/thorfile.rb +16 -10
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dbbec9afc56500b3da2e30f91230f9b139555402feeae7b049f38b03ae0bb96
|
|
4
|
+
data.tar.gz: eb281e757615355b17382e436e92989479e16a53ee3eeba445068ee679da53d4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebe006631fc65c190cac81dac692b610b1fe8d744135926f6c7199763cf80933d20b5093e919ee26eeb6d551261f91e1899d8102000d8b1e9a9a5a94f67a7d27
|
|
7
|
+
data.tar.gz: a88294e91a455269c059328f58d76e220ceb643484ae64afd37bb8d3311e619eb98343c5911d1c26de5b00344a5ad9a5fbd0989df5a2934606ac29875f1819bf
|
data/CHANGELOG.md
CHANGED
data/lib/tasks/thorfile.rb
CHANGED
|
@@ -4,25 +4,31 @@ class CSVTasks < Thor
|
|
|
4
4
|
namespace "dradis:plugins:csv"
|
|
5
5
|
|
|
6
6
|
desc "export", "export issues to a CSV file"
|
|
7
|
+
method_option :output, required: false, type: :string, desc: "the report file to create (if ends in .csv), or directory to create it in"
|
|
7
8
|
def export
|
|
8
9
|
require 'config/environment'
|
|
9
10
|
|
|
11
|
+
report_path = options.output || Rails.root.join('tmp')
|
|
12
|
+
unless report_path.to_s =~ /\.csv\z/
|
|
13
|
+
date = DateTime.now.strftime("%Y-%m-%d")
|
|
14
|
+
base_filename = "dradis-report_#{date}.csv"
|
|
15
|
+
|
|
16
|
+
report_filename = NamingService.name_file(
|
|
17
|
+
original_filename: base_filename,
|
|
18
|
+
pathname: Pathname.new(report_path)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
report_path = File.join(report_path, report_filename)
|
|
22
|
+
end
|
|
23
|
+
|
|
10
24
|
detect_and_set_project_scope
|
|
11
25
|
|
|
12
26
|
exporter = Dradis::Plugins::CSVExport::Exporter.new(task_options)
|
|
13
27
|
csv = exporter.export()
|
|
14
28
|
|
|
15
|
-
|
|
16
|
-
base_filename = "dradis-report_#{date}.csv"
|
|
17
|
-
|
|
18
|
-
filename = NamingService.name_file(
|
|
19
|
-
original_filename: base_filename,
|
|
20
|
-
pathname: Rails.root
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
File.open(filename, 'w') { |f| f.write csv }
|
|
29
|
+
File.open(report_path, 'w') { |f| f.write csv }
|
|
24
30
|
|
|
25
|
-
logger.info "
|
|
31
|
+
logger.info "Report file created at:\n\t#{report_path}"
|
|
26
32
|
end
|
|
27
33
|
|
|
28
34
|
end
|