to_llm 0.1.4 → 0.1.5

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: 272e53a0ac0f7884371c9fa523c60f32dd23b4241d0dcc949c407fa4b45dea86
4
- data.tar.gz: ef6267d899e4793b1c8d2763f2491fbd586ee1a503d105f3f394a4cdb2a1a7f8
3
+ metadata.gz: 4ad8dc7aa1fe23ab7edadb158054251138e6fa9d5b4f7412415f6ac8c6260328
4
+ data.tar.gz: a036334beb2f709b76b240a864429e147055796010a1d9f3f73d40cf6e26a214
5
5
  SHA512:
6
- metadata.gz: 79446a1b1042821384978913b7ff1d5b098020baeae8fb0df623c907d63273f7f40823d27c7c0953850b3630f2e972b6e40639f046929cbbabe33bb39965a091
7
- data.tar.gz: f164be05f14d0581269830a483a5657c943e1f8c80cdf69bc2099fceb31d23113f9dd6c4c03e67dca3f0a2afdc139f58acc96fd4017dfb4a9b9d6123fbed8c52
6
+ metadata.gz: 70fa48467dda813b75e72b0d8c4b4efd1145a782c6de1b3f63dad2b0e7b29c4e0f2aa953a86bea2221d05cbba0e11e7bf0afb166381f96362e6bb2a7ab8080cd
7
+ data.tar.gz: 8163a2ccb4a46d6a59f5b9987f13ff072ebdf6b831c5d0a02f3d35621d23d0439cecc9978db61548357c8a22140e4ed7854e7481270192645d8a8ca9da5fff8c
@@ -2,6 +2,11 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  namespace :to_llm do
5
+ def clean_content(content)
6
+ cleaned = content.lines.map(&:strip).join("\n")
7
+ cleaned.gsub(/\n{2,}/, "\n")
8
+ end
9
+
5
10
  def run_extraction(extract_type, output_format)
6
11
  extract_type = extract_type&.upcase || "ALL"
7
12
  output_format = output_format&.downcase || "txt"
@@ -58,6 +63,7 @@ namespace :to_llm do
58
63
 
59
64
  # Writes file content in either txt or md format
60
65
  def write_content(path, content, output_format, output_file)
66
+ content = clean_content(content)
61
67
  if output_format == "md"
62
68
  language = detect_language(File.extname(path))
63
69
  <<~MARKDOWN
@@ -70,7 +76,7 @@ namespace :to_llm do
70
76
  # txt format
71
77
  <<~TXT
72
78
  #{path}:
73
- ----------------------------------------------------
79
+ -
74
80
  #{content}
75
81
 
76
82
  TXT
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ToLLM
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_llm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Carlos Maciel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails