zon-rb 0.3.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 818004dd00ec5169c64a80953c55e2b49f9b92a7691aef46251463e671c8a033
4
- data.tar.gz: 2519a754dd2e2cc19ee40c8dbfa7c2ae0370e5bd33fc6e69f7dcc0bebd56eb00
3
+ metadata.gz: cfe9708b17f18a4d1d52b8aacd0fa8f49c65d36f61273cc6a587524321b94124
4
+ data.tar.gz: 7be72cc76bf2445439538284c7cffade4fe9ba18242aeb2846912ef722e361ae
5
5
  SHA512:
6
- metadata.gz: e03c8137c996cb03adc77ddebc0afbb95a6cb078f635052eb88dfb2b782365e7ca335aa5436560619b20e246d7693ba96860625943b780deb15c1a2386ef9472
7
- data.tar.gz: 497d4a8b6b830abe6b533fdbb22407524616f5b44727d7c73d8a0f9e49105a7db6d2941396c3a904e4dcfc029c0f5157eb4dfe1db63b22248032d56052403344
6
+ metadata.gz: 4a7704ff2f42b6458a454f36cb162a341babdd16436087eb33679685ba2af98ad550e3014a3eea5b075b1a3d68b3105088b66b430abb446b9155d4ba557c610d
7
+ data.tar.gz: 5f56e5ae9a072709caf95b9112c450a2b3279ee2a2f6024768eb99f98d6d353b976badc2481ef13eb58d2f5ca97415c5710500c8e5ea5f1966c044d26cc60437
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.3.2] - 2026-08-01
2
+
3
+ - Temporary fix for calculating package hashes where "" is used as path.
4
+
1
5
  ## [0.2.0] - 2025-09-27
2
6
 
3
7
  - Added basic Zig package manifest support.
data/lib/zon/hasher.rb CHANGED
@@ -33,9 +33,7 @@ module Zon
33
33
  class Hasher
34
34
  attr_reader :paths, :total_size, :digest
35
35
 
36
- SUPPORTED_ZIG_VERSIONS = ["0.14.0", "0.14.1", "0.15.1", "0.15.2"]
37
-
38
- def initialize(package_path, manifest_name: "build.zig.zon")
36
+ def initialize(package_path, manifest_name: "build.zig.zon", debug: false)
39
37
  # Make sure we have a valid path to work with
40
38
  @package_path = package_path
41
39
  raise ArgumentError, "not a directory '#{@package_path}'" if not Dir.exist? @package_path
@@ -49,6 +47,7 @@ module Zon
49
47
  raise ArgumentError, "no 'version' field in ZON manifest '#{manifest_path}'" if not @manifest.key? :version
50
48
  raise ArgumentError, "no 'fingerprint' field in ZON manifest '#{manifest_path}'" if not @manifest.key? :fingerprint
51
49
 
50
+ @debug = debug
52
51
  @paths = []
53
52
  @results = {}
54
53
  @total_size = 0
@@ -60,7 +59,11 @@ module Zon
60
59
  if File.directory? full_path
61
60
  f = Find.find(full_path)
62
61
  f.each do |p|
63
- next if File.directory? p
62
+ # TODO: it seems like when "" is used as path, hidden folders
63
+ # like .git are not considered but hidden files like .gitignore
64
+ # are. Make this more robust by removing all hidden folders that
65
+ # are not explicitely listed in the manifest.
66
+ next if File.directory? p or p.include? ".git/"
64
67
 
65
68
  pstr = p.delete_prefix(@package_path)[1..]
66
69
  @paths.append(pstr) if not @paths.include? pstr
@@ -89,6 +92,8 @@ module Zon
89
92
  # Hash all files individually
90
93
  @paths.each do |str|
91
94
  @results[str] = Zon::Zig::Hasher::hash_file(@package_path, str)
95
+
96
+ puts "file: #{@results[str][:digest]}: #{str}" if @debug
92
97
  end
93
98
 
94
99
  sha2 = Digest::SHA2.new
data/lib/zon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zon
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zon-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Sugar
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: This gem allows you to translate Zig Object Notation (ZON) data into
13
13
  Ruby objects and vice versa.
@@ -32,13 +32,13 @@ files:
32
32
  - lib/zon/zig.rb
33
33
  - lib/zon/zon_grammar.treetop
34
34
  - sig/zon.rbs
35
- homepage: https://github.com/r4gus/zon-rb
35
+ homepage: https://codeberg.org/r4gus/zon-rb
36
36
  licenses:
37
37
  - MIT
38
38
  metadata:
39
- homepage_uri: https://github.com/r4gus/zon-rb
40
- source_code_uri: https://github.com/r4gus/zon-rb
41
- changelog_uri: https://github.com/r4gus/zon-rb/blob/master/CHANGELOG.md
39
+ homepage_uri: https://codeberg.org/r4gus/zon-rb
40
+ source_code_uri: https://codeberg.org/r4gus/zon-rb
41
+ changelog_uri: https://codeberg.org/r4gus/zon-rb/raw/branch/master/CHANGELOG.md
42
42
  rdoc_options: []
43
43
  require_paths:
44
44
  - lib
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 3.6.2
56
+ rubygems_version: 4.0.16
57
57
  specification_version: 4
58
58
  summary: Zig Object Notation (ZON) support for Ruby
59
59
  test_files: []