ace-support-items 0.15.4 → 0.15.6
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 +13 -0
- data/lib/ace/support/items/molecules/field_updater.rb +25 -19
- data/lib/ace/support/items/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2087dba6ece279d58921d98a503866b9b71bee16454bf087a73e475f3f9867d3
|
|
4
|
+
data.tar.gz: cea39cc5db5a8841731e4407256bfae628fd80ff69c9e34d5225273a30e73562
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97701a1dbb3bd4664c05178cae3a712b0f520d72f20a46df9e4d2ddba323780a5e765327b5ce328703091b1210bbe18927f69258aed858fff0fe04618f5b38a8
|
|
7
|
+
data.tar.gz: 97d6a6b1d537a8e0f07c1268e624b618ca116a25f12a02ebdc5b197d2d543d2e421ee2598ca662086c2129d888ac1e7d09afc85abafc54a77e014791bb96da4b
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.15.6] - 2026-03-29
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- `FieldUpdater`: serialize same-file frontmatter mutations with an exclusive lock across the full read-modify-write cycle so concurrent updates do not silently lose one writer's changes.
|
|
14
|
+
|
|
15
|
+
### Technical
|
|
16
|
+
- Added a cross-process regression that proves frontmatter updates wait on the file lock and preserve the latest locked-file edits before applying their own mutation.
|
|
17
|
+
|
|
18
|
+
## [0.15.5] - 2026-03-29
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **ace-support-items v0.15.5**: Bumped dependency constraints to currently available `~>` ranges on RubyGems and updated release metadata after dependency synchronization.
|
|
22
|
+
|
|
10
23
|
## [0.15.4] - 2026-03-26
|
|
11
24
|
|
|
12
25
|
### Fixed
|
|
@@ -20,19 +20,24 @@ module Ace
|
|
|
20
20
|
# @param remove [Hash] Fields to remove from arrays (key => value or array of values).
|
|
21
21
|
# @return [Hash] Updated frontmatter hash
|
|
22
22
|
def self.update(file_path, set: {}, add: {}, remove: {})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# Strip leading newline from body so rebuild doesn't double-space
|
|
26
|
-
body = body.sub(/\A\n/, "")
|
|
23
|
+
File.open(file_path, File::RDWR) do |file|
|
|
24
|
+
file.flock(File::LOCK_EX)
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
file.rewind
|
|
27
|
+
content = file.read
|
|
28
|
+
frontmatter, body = Atoms::FrontmatterParser.parse(content)
|
|
29
|
+
# Strip leading newline from body so rebuild doesn't double-space
|
|
30
|
+
body = body.sub(/\A\n/, "")
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
apply_set(frontmatter, set)
|
|
33
|
+
apply_add(frontmatter, add)
|
|
34
|
+
apply_remove(frontmatter, remove)
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
new_content = Atoms::FrontmatterSerializer.rebuild(frontmatter, body)
|
|
37
|
+
rewrite_locked_file(file, new_content)
|
|
38
|
+
|
|
39
|
+
frontmatter
|
|
40
|
+
end
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
# Apply --set operations (supports nested dot-key paths).
|
|
@@ -102,17 +107,18 @@ module Ace
|
|
|
102
107
|
target[parts.last] = value
|
|
103
108
|
end
|
|
104
109
|
|
|
105
|
-
#
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
# Rewrite content in-place on a locked file descriptor.
|
|
111
|
+
# This preserves the lock across the full read-modify-write cycle so
|
|
112
|
+
# concurrent updaters serialize instead of losing one writer's changes.
|
|
113
|
+
def self.rewrite_locked_file(file, content)
|
|
114
|
+
file.rewind
|
|
115
|
+
file.truncate(0)
|
|
116
|
+
file.write(content)
|
|
117
|
+
file.flush
|
|
118
|
+
file.fsync
|
|
113
119
|
end
|
|
114
120
|
|
|
115
|
-
private_class_method :apply_nested_set, :
|
|
121
|
+
private_class_method :apply_nested_set, :rewrite_locked_file
|
|
116
122
|
end
|
|
117
123
|
end
|
|
118
124
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ace-support-items
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.15.
|
|
4
|
+
version: 0.15.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michal Czyz
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0.
|
|
18
|
+
version: '0.29'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.29'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: ace-b36ts
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0.
|
|
32
|
+
version: '0.13'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '0.
|
|
39
|
+
version: '0.13'
|
|
40
40
|
description: Provides shared infrastructure for folder-based item management (tasks,
|
|
41
41
|
ideas, etc.) across ace-* gems. Includes document loading, frontmatter parsing/serialization,
|
|
42
42
|
filtering, sorting, directory scanning, and shortcut resolution.
|