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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 861efab741f9c9c6445d2c5f877e08c6f7da36e01254719191d1976baaff398b
4
- data.tar.gz: d2f7efdca7e96cd0f4d65589014ab0a137bde8ce22c1b3edd9bc15dd21425606
3
+ metadata.gz: ab8bbc27c3a72a3efd7dbb3cb63453936a5f520b0a72e50ca8c89fa79d296a0b
4
+ data.tar.gz: 28a32dc6e3c7d98ac4b795c012e36ea8e02eb8a72dd4115f08ad7c808e27f251
5
5
  SHA512:
6
- metadata.gz: 49017796cabf1aea3026d39049e8ffdd085b9806e81574797cecc14e2e2c46502db6e7a0f8a37c44c26cc78f86f4d71d29f5db2576108970bee290c76dad39ba
7
- data.tar.gz: 14201839ae140bb2f4a35bef52c581a95b9e6a0939db7a16b12feea7a8ac8cdf46f449564720829df689b63eaf0c198d268448498fac70f5955073aed4bc84e0
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(@registry_path)
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
@@ -15,8 +15,8 @@ module WideEvent
15
15
  end
16
16
 
17
17
  initializer "wide_event.registry" do |app|
18
- path = app.root.join("config", "wide_event", "registry.yml")
19
- WideEvent.config.registry_path ||= path.to_s if path.exist?
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
@@ -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
- lines << "| `#{key}` | #{Array(entry["type"]).join(", ")} | #{entry["set_by"]} | #{entry["pii"]} | #{entry["notes"]} |"
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-events attribute registry\n\n" \
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)
@@ -1,3 +1,3 @@
1
1
  module WideEvent
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wide_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Miribyan