wide_events 0.1.3 → 0.1.4
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 +14 -0
- data/lib/wide_event/configuration.rb +10 -1
- data/lib/wide_event/railtie.rb +2 -2
- data/lib/wide_event/registry.rb +10 -1
- data/lib/wide_event/tasks/registry.rake +1 -1
- data/lib/wide_event/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: ab8bbc27c3a72a3efd7dbb3cb63453936a5f520b0a72e50ca8c89fa79d296a0b
|
|
4
|
+
data.tar.gz: 28a32dc6e3c7d98ac4b795c012e36ea8e02eb8a72dd4115f08ad7c808e27f251
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f27aefb767cff731bc999fdec722d2a2ea0195dcd4e8d9d37b6f406c85725eed9a4594d279554a58fe27cdb8c5a92ac33f043ff9748439d546fb0825c3eba382
|
|
7
|
+
data.tar.gz: a3f1b8b6c52d66a045d08284fc101b036470509c571696f2f324c42451225db2f8e0dfaacac431aa2b966e8250761321f799387ab778c9c43a73f002497de6e9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.1.4 (2026-08-04)
|
|
4
|
+
|
|
5
|
+
- The railtie stores `registry_path` relative to the app root
|
|
6
|
+
(`config/wide_event/registry.yml`) and `Configuration` resolves it via
|
|
7
|
+
`Rails.root.join` when opening the registry. The generated doc's header
|
|
8
|
+
previously committed the machine-specific absolute path, which rewrote
|
|
9
|
+
itself on every other checkout; it now carries the relative path.
|
|
10
|
+
Explicitly configured absolute paths keep working unchanged.
|
|
11
|
+
- `Registry#to_markdown` collapses whitespace and escapes pipes in every
|
|
12
|
+
cell. A `notes: >` folded scalar keeps a trailing newline, which pushed
|
|
13
|
+
the row's closing pipe onto its own line and split the table.
|
|
14
|
+
- The generated doc's title is "Wide events attribute registry" — no
|
|
15
|
+
hyphen; that spelling belongs to file names, not copy.
|
|
16
|
+
|
|
3
17
|
## v0.1.3 (2026-08-03)
|
|
4
18
|
|
|
5
19
|
- README links to the docs are absolute GitHub URLs, so they work on
|
|
@@ -57,7 +57,16 @@ module WideEvent
|
|
|
57
57
|
|
|
58
58
|
def registry
|
|
59
59
|
return nil if @registry_path.nil?
|
|
60
|
-
@registry ||= Registry.load(
|
|
60
|
+
@registry ||= Registry.load(resolved_registry_path)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
private
|
|
64
|
+
|
|
65
|
+
# `registry_path` stays relative so the generated doc can commit it;
|
|
66
|
+
# absolute paths win inside Pathname#join and pass through as-is.
|
|
67
|
+
def resolved_registry_path
|
|
68
|
+
root = Rails.root if defined?(Rails) && Rails.respond_to?(:root)
|
|
69
|
+
root ? root.join(@registry_path).to_s : @registry_path
|
|
61
70
|
end
|
|
62
71
|
end
|
|
63
72
|
end
|
data/lib/wide_event/railtie.rb
CHANGED
|
@@ -15,8 +15,8 @@ module WideEvent
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
initializer "wide_event.registry" do |app|
|
|
18
|
-
path =
|
|
19
|
-
WideEvent.config.registry_path ||= path
|
|
18
|
+
path = "config/wide_event/registry.yml"
|
|
19
|
+
WideEvent.config.registry_path ||= path if app.root.join(path).exist?
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# After the app's own initializers, so the host's OpenTelemetry::SDK
|
data/lib/wide_event/registry.rb
CHANGED
|
@@ -66,9 +66,18 @@ module WideEvent
|
|
|
66
66
|
lines = [ "| Attribute | Type | Set by | PII | Notes |", "|---|---|---|---|---|" ]
|
|
67
67
|
entries.each do |key, entry|
|
|
68
68
|
entry = {} unless entry.is_a?(Hash)
|
|
69
|
-
|
|
69
|
+
cells = [ Array(entry["type"]).join(", "), entry["set_by"], entry["pii"], entry["notes"] ]
|
|
70
|
+
lines << "| `#{key}` | #{cells.map { |value| cell(value) }.join(" | ")} |"
|
|
70
71
|
end
|
|
71
72
|
lines.join("\n") + "\n"
|
|
72
73
|
end
|
|
74
|
+
|
|
75
|
+
private
|
|
76
|
+
|
|
77
|
+
# A table cell can hold neither a newline (folded scalars keep a trailing
|
|
78
|
+
# one) nor a bare pipe.
|
|
79
|
+
def cell(value)
|
|
80
|
+
value.to_s.gsub(/\s+/, " ").strip.gsub("|") { "\\|" }
|
|
81
|
+
end
|
|
73
82
|
end
|
|
74
83
|
end
|
|
@@ -16,7 +16,7 @@ namespace :wide_events do
|
|
|
16
16
|
path = ENV["WIDE_EVENTS_DOCS_PATH"] || "docs/wide-events-registry.md"
|
|
17
17
|
require "fileutils"
|
|
18
18
|
FileUtils.mkdir_p(File.dirname(path))
|
|
19
|
-
header = "# Wide
|
|
19
|
+
header = "# Wide events attribute registry\n\n" \
|
|
20
20
|
"Generated from `#{WideEvent.config.registry_path}` by `rake wide_events:registry:docs`. " \
|
|
21
21
|
"Do not edit by hand.\n\n"
|
|
22
22
|
File.write(path, header + registry.to_markdown)
|
data/lib/wide_event/version.rb
CHANGED