inspec-reporter-flex 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a70f1ad5110657323aa557b7876f254052aa80e5e82d0dc2d1bd1fa62e5ee097
4
- data.tar.gz: af696adb163985a265cc85fb0d6da9213f316ad33cc377d3211814abf7d62f25
3
+ metadata.gz: 1736a2271d0d47572a5526143e1be8749458bff449bfff46136d82cfea1da69e
4
+ data.tar.gz: 0c2e251562ed792fc4b422c24c88acac1196a8459856ef58d95d8152a46b4c45
5
5
  SHA512:
6
- metadata.gz: 309b3ee73a2884b4155de09cf5708f62d1fe98241d3a34c41ab051394a42391385af2dbf0acbd899707a3c6cf165967409bd8462d92dba4261de3f0c4503876c
7
- data.tar.gz: 056d903d087b8ca2ac21204d766a0c72547b563dac3d9908ae515ed8b369c7fdadcbd1467cc177e723d112ca09c85d5f54278f1c39c4019f67829492e5d0e3c8
6
+ metadata.gz: bfa59013c14c881cb62f92ddfb5b47a027223a6109e7420a2372f54146b87b390683b8ec40d5911ceb06091ca42ca9f348b13a26b38987dfce3950f6c2820576
7
+ data.tar.gz: be75da5f152ce45b502fb07ad9bc575a1d109201e8ad1b26a7c8b9a79bef2bc361d3914e5439d59c35ca7e507e79ba4e94558556c7ffd63e4493db2f0cfd5061
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.1.3
4
+
5
+ - Fix absolute path detection to check for existence of `template_file`
6
+
3
7
  ## v0.1.2
4
8
 
5
9
  - Fix lookup of `scan_time` ERB helper
@@ -1,3 +1,5 @@
1
+ require 'pathname'
2
+
1
3
  module InspecPlugins::FlexReporter
2
4
  module FileResolver
3
5
  # Resolve the full path for a file in order absolute path/gem bundled file/relative.
@@ -22,7 +24,23 @@ module InspecPlugins::FlexReporter
22
24
  # @param [String] name name or path of a file
23
25
  # @return [Boolean] if it is an absolute path
24
26
  def absolute_path?(name)
25
- name.start_with? "/"
27
+ absolute_unix_path?(name) || absolute_windows_path?(name)
28
+ end
29
+
30
+ # Is this an absolute path on UNIX systems?
31
+ #
32
+ # @param [String] name name or path of a file
33
+ # @return [Boolean] if it is an absolute path
34
+ def absolute_unix_path?(name)
35
+ File.exist?(name) && name.start_with?("/")
36
+ end
37
+
38
+ # Is this an absolute path on Windows systems?
39
+ #
40
+ # @param [String] name name or path of a file
41
+ # @return [Boolean] if it is an absolute path
42
+ def absolute_windows_path?(name)
43
+ File.exist?(name) && name.match?(/^[a-zA-C]:/)
26
44
  end
27
45
 
28
46
  # Is this an relative path?
@@ -1,5 +1,5 @@
1
1
  module InspecPlugins
2
2
  module FlexReporter
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspec-reporter-flex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Heinen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-20 00:00:00.000000000 Z
11
+ date: 2021-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bump
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.0.3
118
+ rubygems_version: 3.1.4
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: InSpec Reporter for flexible, template-based reports