llmed 0.3.13 → 0.3.15

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: d27122a6a39c8e8b65fcb2904770a1df40607a81fe4fc3509c64852c18166757
4
- data.tar.gz: a8ad73c893af6e83223d37e0b7942748e5083afcf741ab3845f48f9819949745
3
+ metadata.gz: 30eeed29b9cd4f299f5068f1f1a81a8fe66e0b4b621716a5c0a0485bd7585bcb
4
+ data.tar.gz: 0eeae9aaa6bf875acdfa19f6de7ee81d8ddf9758b70b969ac2fb3cb837f9857f
5
5
  SHA512:
6
- metadata.gz: 952651684be39c509da0cbfaf4472487b03d19eb312fa2d28a4a22f4e940b5dc9a4d9e22123b52a42105e14d85c42e95dad7c830045d32df0303d43b65fdb0de
7
- data.tar.gz: 06cff7578b503ede8222a1152653e3e195cd67ac717dbbbcd9f36d793beb1959ba7090757fd857795f4d45688ca8b544d0e3c9cf8e5080f7d733d1f3826a9b83
6
+ metadata.gz: b48247b4d11fc5288613a19559f2fa6f0087538f9f537348b9a05c8a77d3220a082dc97f6054d807c37621ab3cc6ca0931a8fb1759fb35598eeb08eea0b6683f
7
+ data.tar.gz: a698093a3166e0804de4cf7ad75e1ef1c49d6873d2101384fc8369fdd134c770c0c2c66519c3dc42354627ae51a67602bb59b137a6d99db4b1d38e15e0f67420
@@ -68,6 +68,7 @@ class LLMed
68
68
  FileUtils.cp(output_file, release_main_source_code)
69
69
  @logger.info("APPLICATION #{@name} RELEASE FILE #{release_source_code}")
70
70
  elsif @release && !File.exist?(output_file) && File.exist?(release_main_source_code)
71
+ FileUtils.mkdir_p(File.dirname(output_file))
71
72
  FileUtils.cp(release_main_source_code, output_file)
72
73
  return
73
74
  end
data/lib/llmed/context.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # Copyright 2025 Jovany Leandro G.C <bit4bit@riseup.net>
2
2
  # frozen_string_literal: true
3
+ require 'erb'
3
4
 
4
5
  class LLMed
5
6
  class Context
@@ -47,6 +48,12 @@ class LLMed
47
48
  File.read(path)
48
49
  end
49
50
 
51
+ # Example:
52
+ # context("application") { from_erb("application.cllmed.erb") }
53
+ def from_erb(path)
54
+ ERB.new(File.read(path)).result(binding)
55
+ end
56
+
50
57
  # Example:
51
58
  # context("source") { from_source_code("sourcepathtoinclude") }
52
59
  def from_source_code(path)
@@ -0,0 +1,50 @@
1
+ require 'toml-rb'
2
+
3
+ class LLMed
4
+ class LiterateProgramming
5
+ ContentString = Struct.new(:content, keyword_init: true) do
6
+ def to_s
7
+ content
8
+ end
9
+ end
10
+ ContentFencedBlock = Struct.new(:format, :arguments, :content, keyword_init: true)
11
+ Context = Struct.new(:name, :content, :content_desc, keyword_init: true)
12
+ Application = Struct.new(:configuration, :contexts, keyword_init: true)
13
+
14
+ class Markdown
15
+
16
+ def parse(content)
17
+ content.scan(/^---(.+?)---\n(.+)/m) => [[configuration_data, application_data]]
18
+
19
+ app = Application.new(configuration: TomlRB.parse(configuration_data), contexts: [])
20
+
21
+ application_data.split(/^# /)
22
+ .reject{|c| c.empty?}
23
+ .each do |context_data|
24
+ case context_data.split("\n", 2)
25
+ in ["", ""]
26
+ # omit
27
+ in [name, content]
28
+ context_desc = []
29
+ content.split(/(```.*```)/mi).each do |line|
30
+ if line.start_with?("```")
31
+ line.scan(/```(.+?)\n(.+)```/mi) => [[fenced_data, fenced_content]]
32
+ fenced_params = fenced_data.split(",")
33
+ format = fenced_params.shift
34
+ arguments = fenced_params.map{|item| item.split("=", 2)}.to_h
35
+
36
+ context_desc << ContentFencedBlock.new(format: format, arguments: arguments, content: fenced_content)
37
+ else
38
+ context_desc << ContentString.new(content: line)
39
+ end
40
+ end
41
+
42
+ app.contexts << Context.new(name: name, content: content, content_desc: context_desc)
43
+ end
44
+ end
45
+
46
+ app
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,4 @@
1
+ class LLMed
2
+ class LiterateProgramming::Markdown
3
+ end
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llmed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jovany Leandro G.C
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-06-18 00:00:00.000000000 Z
11
+ date: 2025-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: langchainrb
@@ -104,6 +104,8 @@ files:
104
104
  - lib/llmed/context.rb~
105
105
  - lib/llmed/deployment.rb
106
106
  - lib/llmed/deployment.rb~
107
+ - lib/llmed/literate_programming.rb
108
+ - lib/llmed/literate_programming.rb~
107
109
  - lib/llmed/release.rb
108
110
  - lib/llmed/release.rb~
109
111
  homepage: https://github.com/bit4bit/llmed