llmed 0.3.16 → 0.3.17
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/lib/llmed/application.rb +1 -0
- data/lib/llmed/configuration.rb +3 -1
- data/lib/llmed/release.rb +20 -3
- 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: 52b2451c2b753bce4e00ee940d19d61f299b95dbf78503f6338b12732ec90e34
|
4
|
+
data.tar.gz: 59b763a108c1823fe8a81517386a5cc11d7a41d3171aab09d0d977baf4154f6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72e2cb9a8e97fcb9025a4c830e37b637a92cc0a0a997715fc1e60456d62b2fec337c0c57f85d03ff14488aa038b45737f2e8204714c6c425925bd78cfef64efe
|
7
|
+
data.tar.gz: 90b0df91f71029a50fe254b851799e201bb6b26170d2c9ebb5beb71085d1c272357d2568527ea2cc3b16179e3dee5b92b27d5de1b0cae4bc61b077d3731eebcd
|
data/lib/llmed/application.rb
CHANGED
@@ -102,6 +102,7 @@ class LLMed
|
|
102
102
|
output_release = Release.load(File.read(release_source_code), @code_comment)
|
103
103
|
input_release = Release.load(output, @code_comment)
|
104
104
|
output_content = output_release.merge!(input_release, user_contexts).content
|
105
|
+
|
105
106
|
output_release.changes.each do |change|
|
106
107
|
action, ctx = change
|
107
108
|
case action
|
data/lib/llmed/configuration.rb
CHANGED
@@ -15,9 +15,11 @@ There is always a one-to-one correspondence between context and source code.
|
|
15
15
|
Always include the properly escaped comment: LLMED-COMPILED.
|
16
16
|
|
17
17
|
You must only modify the following source code:
|
18
|
+
```
|
18
19
|
{source_code}
|
20
|
+
```
|
19
21
|
|
20
|
-
Only generate source code of the context who digest belongs to {update_context_digests}
|
22
|
+
Only generate source code of the context who digest belongs to {update_context_digests}.
|
21
23
|
|
22
24
|
Wrap with comment every code that belongs to the indicated context, example in {language}:
|
23
25
|
{code_comment_begin}<llmed-code context='context name' digest='....' after='digest next context'>{code_comment_end}
|
data/lib/llmed/release.rb
CHANGED
@@ -106,13 +106,30 @@ class LLMed
|
|
106
106
|
# insertions missed user contexts
|
107
107
|
user_contexts.each do |name, digest|
|
108
108
|
next if contexts.any? { |ctx| ctx.name == name }
|
109
|
-
|
110
|
-
new_ctx = ContextCode.new(name, digest,
|
109
|
+
code = release.context_by(name).code
|
110
|
+
new_ctx = ContextCode.new(name, digest, code, '')
|
111
111
|
contexts.prepend(new_ctx)
|
112
112
|
@changes << [:added, new_ctx]
|
113
113
|
end
|
114
114
|
|
115
|
-
|
115
|
+
contexts_sorted = []
|
116
|
+
# prioritize user order
|
117
|
+
user_contexts.each do |name, _digest|
|
118
|
+
contexts.each do |ctx|
|
119
|
+
if ctx.name == name
|
120
|
+
contexts_sorted << ctx
|
121
|
+
break
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
@contexts = contexts_sorted.sort {|a,b|
|
127
|
+
if a.digest == b.after
|
128
|
+
1
|
129
|
+
else
|
130
|
+
0
|
131
|
+
end
|
132
|
+
}
|
116
133
|
self
|
117
134
|
end
|
118
135
|
|