swhid 0.4.1 → 0.4.2
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 +9 -0
- data/exe/swhid +4 -0
- data/lib/swhid/from_filesystem.rb +6 -3
- data/lib/swhid/version.rb +1 -1
- 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: 16ba287ac96b6a5e50f4dd578cbb4af414d360dd1b4de71d0d8c335eca848891
|
|
4
|
+
data.tar.gz: a4d5c2f729d7cb608abbfdec6dea9813c8baf4c64fbc78c703bef2cb40836f86
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 04e2af979856db63384d9080b60182e0e62ffbf6ddeb93dc6037c52a22979eaed8b00d116aa3c7ca47081c2984314b157dd308493d7d1f66159b3c62088f1d18
|
|
7
|
+
data.tar.gz: e10d4fa950666e101c872cb033b4e094bcc149131eebddac8431623569805ea7b909633417b4b30da628d3f3774ef2a34dcac05bcb5fb86f34159845d45a871a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.4.2] - 2026-01-14
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- CLI now reads stdin and writes stdout in binary mode (fixes CRLF and binary file handling on Windows)
|
|
7
|
+
- Normalize path separators for Git index lookups on Windows
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- CLI integration tests for binary content and line ending preservation
|
|
11
|
+
|
|
3
12
|
## [0.4.1] - 2026-01-13
|
|
4
13
|
|
|
5
14
|
### Fixed
|
data/exe/swhid
CHANGED
|
@@ -6,6 +6,9 @@ require "swhid"
|
|
|
6
6
|
require "optparse"
|
|
7
7
|
require "json"
|
|
8
8
|
|
|
9
|
+
# Ensure consistent LF line endings on all platforms
|
|
10
|
+
$stdout.binmode
|
|
11
|
+
|
|
9
12
|
class SwhidCLI
|
|
10
13
|
def initialize(args)
|
|
11
14
|
@args = args
|
|
@@ -96,6 +99,7 @@ class SwhidCLI
|
|
|
96
99
|
end
|
|
97
100
|
|
|
98
101
|
def compute_content_swhid
|
|
102
|
+
$stdin.binmode
|
|
99
103
|
content = $stdin.read
|
|
100
104
|
|
|
101
105
|
swhid = Swhid.from_content(content)
|
|
@@ -86,13 +86,16 @@ module Swhid
|
|
|
86
86
|
full_path = File.realpath(full_path) rescue File.expand_path(full_path)
|
|
87
87
|
repo_workdir = File.realpath(repo_workdir) rescue File.expand_path(repo_workdir)
|
|
88
88
|
|
|
89
|
+
# Normalize path separators for consistent comparison (especially on Windows)
|
|
90
|
+
full_path = full_path.tr("\\", "/")
|
|
91
|
+
repo_workdir = repo_workdir.tr("\\", "/")
|
|
92
|
+
|
|
89
93
|
# Ensure repo_workdir ends with separator for proper prefix matching
|
|
90
|
-
repo_workdir = repo_workdir.chomp("/")
|
|
94
|
+
repo_workdir = repo_workdir.chomp("/") + "/"
|
|
91
95
|
|
|
92
96
|
return nil unless full_path.start_with?(repo_workdir)
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
relative.tr("\\", "/")
|
|
98
|
+
full_path.sub(repo_workdir, "")
|
|
96
99
|
end
|
|
97
100
|
end
|
|
98
101
|
end
|
data/lib/swhid/version.rb
CHANGED