woods 1.6.0 → 1.6.1

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: f001f56232acc78a70a3b8584e1bb7dc7d94d9d0f6fa3d34a749bc963d2a361f
4
- data.tar.gz: d9f5e7b0ff143d8d71e4368ce961e946cfc0a5b380793e6f4e190fedae968375
3
+ metadata.gz: 4a3bf50a7ad421cc52a336375446c4e08c2583dbf2ce96e4a3038bd8dca7a0ae
4
+ data.tar.gz: fe9a6512787372c3f3d0cbe4038720f123349b9961c548b1584d21b8b4cbd0fb
5
5
  SHA512:
6
- metadata.gz: 5486c78c71a80e6c6445e149ff791dce250cf08503309ac0099e517ea680de3759da359a6e5a819963013f80d4ad3fe83b3f46b43e8d81d560cfaa4034a47552
7
- data.tar.gz: 2af74e73f867a605a4ad5ca2770ea148583bd02c1e520ff87fb34bee0ca09be9dad2888875a37c97f3a620e877320dc32ee676e081c911f0c0ad6253bfe8604e
6
+ metadata.gz: 7070f985d4a9bab191593599e4f4f8c807d0378c8345a9aa8a73c2ac4de0200b7959ffd6bb6a823bb12fd67a4afe90ad6d3475eb16bbb60ac320ead1de114b77
7
+ data.tar.gz: 3c0cd27167baa9cd7e0245894527760e12bf2d038e57819ffa78468e6f0e6e4122dd144129bcfd769bd89965caad7c997299dfc5de9c1c38dfddb88bab8f2f78
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.6.1] - 2026-07-22
11
+
12
+ ### Fixed
13
+
14
+ - **Incremental extraction crash on multi-unit files.** `woods:incremental` raised
15
+ `NoMethodError: undefined method 'identifier' for an instance of Array` when re-extracting a
16
+ unit whose extractor returns several units from one file (a `.rake` file defining multiple
17
+ tasks; i18n, migration, and lib files are shaped the same way). `Extractor#re_extract_unit`
18
+ now normalizes the extractor result to an array and registers and writes each unit, matching
19
+ how full extraction already handles per-type results. Full extraction was unaffected.
20
+
10
21
  ## [1.6.0] - 2026-07-16
11
22
 
12
23
  ### Added
@@ -1127,27 +1127,36 @@ module Woods
1127
1127
 
1128
1128
  return unless unit
1129
1129
 
1130
- # Update dependency graph. Register BEFORE normalizing the path
1131
- # the graph's file_map stores absolute paths (affected_by matches
1132
- # changed files against them), exactly as full extraction registers
1133
- # in Phase 1 and only normalizes in Phase 4.5.
1134
- @dependency_graph.register(unit)
1130
+ # File-based extractors can return several units from one file (a .rake
1131
+ # file defining multiple tasks, etc.); class-based extractors return one.
1132
+ # Normalize to an array so every unit is registered and written — passing
1133
+ # an Array straight to DependencyGraph#register crashes on unit.identifier.
1134
+ units = unit.is_a?(Array) ? unit : [unit]
1135
+ return if units.empty?
1135
1136
 
1136
1137
  # Track which type was affected
1137
1138
  affected_types&.add(extractor_key)
1138
1139
 
1139
- # Unit JSON carries Rails.root-relative paths (full extraction's
1140
- # Phase 4.5); writing the raw absolute source_location here would
1141
- # leak container-absolute paths into the index after incremental runs.
1142
- unit.file_path = normalize_file_path(unit.file_path)
1143
-
1144
- # Write updated unit
1145
1140
  type_dir = @output_dir.join(extractor_key.to_s)
1146
1141
 
1147
- File.write(
1148
- type_dir.join(collision_safe_filename(unit.identifier)),
1149
- json_serialize(unit.to_h)
1150
- )
1142
+ units.each do |extracted|
1143
+ # Update dependency graph. Register BEFORE normalizing the path —
1144
+ # the graph's file_map stores absolute paths (affected_by matches
1145
+ # changed files against them), exactly as full extraction registers
1146
+ # in Phase 1 and only normalizes in Phase 4.5.
1147
+ @dependency_graph.register(extracted)
1148
+
1149
+ # Unit JSON carries Rails.root-relative paths (full extraction's
1150
+ # Phase 4.5); writing the raw absolute source_location here would
1151
+ # leak container-absolute paths into the index after incremental runs.
1152
+ extracted.file_path = normalize_file_path(extracted.file_path)
1153
+
1154
+ # Write updated unit
1155
+ File.write(
1156
+ type_dir.join(collision_safe_filename(extracted.identifier)),
1157
+ json_serialize(extracted.to_h)
1158
+ )
1159
+ end
1151
1160
 
1152
1161
  Rails.logger.info "[Woods] Re-extracted #{unit_id}"
1153
1162
  end
data/lib/woods/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Woods
4
- VERSION = '1.6.0'
4
+ VERSION = '1.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leah Armstrong
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-16 00:00:00.000000000 Z
11
+ date: 2026-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mcp