to_llm 0.1.0 → 0.1.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -14
  3. data/lib/tasks/to_llm.rake +7 -4
  4. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 522bcb09f3066274f26eba424d65b7bd520f74e04c55c83f0b0a56640f787b69
4
- data.tar.gz: 59c1905979d7beae0930d23a465e6ee0b3c6e64a0451fed97c90f90daa6aa566
3
+ metadata.gz: ada141bafdd63b00f12af14c5d5150a8de09deb030f6dd9605780af6acf2c01f
4
+ data.tar.gz: 05ac140d21cd33acb30f88914673a695ea9859479d0d115d8154826c04ee090b
5
5
  SHA512:
6
- metadata.gz: 6ef6416cc24a686d615add69c851cc1241797f1ef20ec2913fc8c2029296771aef89877c93ab8e9c7a2fb4f4e7e7dfffad9c790249f45593e0c3e02a37665158
7
- data.tar.gz: 44ce278ed645cec0fbbebb282da7e69a9b87f921643a0c6fac6404b28f68ad37073973ca8102aa044daf117cabb2b33d4a6306472878b1eb749ab332f4e28535
6
+ metadata.gz: f63a54f041713178db91321fb2efd3fdce44103007da3de130f451df8892a93728cb72e816cf9f953627d44626fe2561e5bdfc464f7ca71628c47b6703c54960
7
+ data.tar.gz: 046b4b51252bbe3d38203b9e5f61eebe7ebd8decc69057eb178690cb8f36d3cfec06748a7497ed1cc26147c15efd09cf7552db898450fa6decfcc2f6242048fd
data/README.md CHANGED
@@ -1,11 +1,6 @@
1
- Below is an example of a **README.md** that you might include in your GitHub repository for a gem named **to_llm**. Feel free to adjust any sections (e.g., badges, license, usage details) to match your project’s specifics.
2
-
3
- ---
4
-
5
1
  # to_llm
6
2
 
7
3
  [![Gem Version](https://badge.fury.io/rb/to_llm.svg)](https://badge.fury.io/rb/to_llm)
8
- [![Build Status](https://github.com/your_user/to_llm/actions/workflows/ci.yml/badge.svg)](https://github.com/your_user/to_llm/actions)
9
4
  [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.txt)
10
5
 
11
6
  **to_llm** is a lightweight Ruby gem that provides a simple set of tasks (or commands) to extract code from a Rails application into text files. This is useful if you want to feed your Rails codebase into a Large Language Model (LLM) or any text-based analysis tool.
@@ -69,7 +64,7 @@ Each of these commands will scan the relevant folders in your Rails app and prod
69
64
 
70
65
  ## Commands
71
66
 
72
- ### 1. `rails to_llm:extract ALL`
67
+ ### 1. `rails to_llm:extract -ALL`
73
68
 
74
69
  - **Description**: Extracts from all supported Rails directories:
75
70
  - `app/models` -> `models.txt`
@@ -80,27 +75,27 @@ Each of these commands will scan the relevant folders in your Rails app and prod
80
75
  - `db/schema.rb` -> `schema.txt`
81
76
  - **Result**: Creates a folder named `to_llm/` with separate `.txt` files.
82
77
 
83
- ### 2. `rails to_llm:extract MODELS`
78
+ ### 2. `rails to_llm:extract -MODELS`
84
79
 
85
80
  - **Description**: Extracts only files from `app/models`.
86
81
  - **Output**: Creates (or overwrites) `to_llm/models.txt`.
87
82
 
88
- ### 3. `rails to_llm:extract CONTROLLERS`
83
+ ### 3. `rails to_llm:extract -CONTROLLERS`
89
84
 
90
85
  - **Description**: Extracts only from `app/controllers`.
91
86
  - **Output**: `to_llm/controllers.txt`.
92
87
 
93
- ### 4. `rails to_llm:extract VIEWS`
88
+ ### 4. `rails to_llm:extract -VIEWS`
94
89
 
95
90
  - **Description**: Extracts from `app/views`.
96
91
  - **Output**: `to_llm/views.txt`.
97
92
 
98
- ### 5. `rails to_llm:extract CONFIG`
93
+ ### 5. `rails to_llm:extract -CONFIG`
99
94
 
100
95
  - **Description**: Extracts from `config`, including `config/initializers`.
101
96
  - **Output**: `to_llm/config.txt`.
102
97
 
103
- ### 6. `rails to_llm:extract SCHEMA`
98
+ ### 6. `rails to_llm:extract -SCHEMA`
104
99
 
105
100
  - **Description**: Extracts only `db/schema.rb`.
106
101
  - **Output**: `to_llm/schema.txt`.
@@ -132,7 +127,7 @@ This gem is intentionally minimalist. Feel free to fork or override these settin
132
127
  ```
133
128
  Generates:
134
129
  ```
135
- extracted_files/
130
+ to_llm/
136
131
  models.txt
137
132
  controllers.txt
138
133
  views.txt
@@ -147,7 +142,7 @@ This gem is intentionally minimalist. Feel free to fork or override these settin
147
142
  ```
148
143
  Generates:
149
144
  ```
150
- extracted_files/
145
+ to_llm/
151
146
  views.txt
152
147
  ```
153
148
  (Note that any previously existing files in `to_llm` will be untouched or overwritten if they have the same filename.)
@@ -168,4 +163,4 @@ We welcome issues, PRs, and general feedback!
168
163
 
169
164
  ## License
170
165
 
171
- This project is available as open source under the terms of the [MIT License](./LICENSE.txt). Feel free to use it in your own projects.
166
+ This project is available as open source under the terms of the [MIT License](./LICENSE.txt). Feel free to use it in your own projects.
@@ -28,22 +28,25 @@ namespace :to_llm do
28
28
  "app/controllers" => "controllers.txt",
29
29
  "app/views" => "views.txt",
30
30
  "app/helpers" => "helpers.txt",
31
- "config" => "config.txt",
31
+ "app/javascript" => "javascript.txt",
32
+ "config" => "config.txt",
32
33
  "db/schema.rb" => "schema.txt"
33
34
  }
34
35
 
35
36
  # We can filter which directories to process based on the user input
36
37
  filter_map = {
37
- "ALL" => %w[app/models app/controllers app/views app/helpers config db/schema.rb],
38
+ "ALL" => %w[app/models app/controllers app/views app/helpers app/javascript config db/schema.rb],
38
39
  "MODELS" => %w[app/models],
39
40
  "CONTROLLERS" => %w[app/controllers],
40
41
  "VIEWS" => %w[app/views],
41
42
  "CONFIG" => %w[config],
42
- "SCHEMA" => %w[db/schema.rb]
43
+ "SCHEMA" => %w[db/schema.rb],
44
+ "JAVASCRIPT" => %w[app/javascript],
45
+ "HELPERS" => %w[app/helpers]
43
46
  }
44
47
 
45
48
  # Define which extensions you want to extract
46
- file_extensions = %w[.rb .erb .js .yml]
49
+ file_extensions = %w[.rb .erb .js .yml .ts .tsx]
47
50
 
48
51
  directories_to_files.values.each do |filename|
49
52
  file_path = File.join(output_dir, filename)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_llm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Carlos Maciel
@@ -40,7 +40,8 @@ files:
40
40
  homepage: https://github.com/jcmaciel/to_llm
41
41
  licenses:
42
42
  - MIT
43
- metadata: {}
43
+ metadata:
44
+ source_code_uri: https://github.com/jcmaciel/to_llm
44
45
  post_install_message:
45
46
  rdoc_options: []
46
47
  require_paths: