appydave-tools 0.11.1 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/docs/usage/gpt-context.md +106 -7
- data/lib/appydave/tools/subtitle_master/_doc.md +6 -1
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave_tools.rb +3 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 769dc5f9807a7ff74b88650593e1db9da4cc81b479df5786a4849e188271bf66
|
4
|
+
data.tar.gz: d461f039fbec1f8afa45c95d64601b6aac7849b125175ce67429432ca625f699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b8ee78c14b791d10b170507ee9525c382b6e9353d68b0fe005ec38a4ec9268cdd8413ca308864ddf2c6c1cf4f4633bd44dd0eaf5375fb6c59f6c5b54bc8854f
|
7
|
+
data.tar.gz: a6253ed35ed13962bec5a5b3ce31f359734bc04106b4e12d58bc8869a9c8df7019b92a0075cf62bd1dc9d119554e0554dced4028daa8f3ec1525f4157d82539f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## [0.11.2](https://github.com/klueless-io/appydave-tools/compare/v0.11.1...v0.11.2) (2024-10-16)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* gpt context documentation updated for using from another gem ([a71072c](https://github.com/klueless-io/appydave-tools/commit/a71072ce24e61dd164f44d7425bad3013f0bdf1f))
|
7
|
+
|
8
|
+
## [0.11.1](https://github.com/klueless-io/appydave-tools/compare/v0.11.0...v0.11.1) (2024-10-16)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* gpt context documentation ([808fccd](https://github.com/klueless-io/appydave-tools/commit/808fccdea10c472522da02c8af7f9a2c9eaf361a))
|
14
|
+
|
1
15
|
# [0.11.0](https://github.com/klueless-io/appydave-tools/compare/v0.10.4...v0.11.0) (2024-10-16)
|
2
16
|
|
3
17
|
|
data/docs/usage/gpt-context.md
CHANGED
@@ -9,11 +9,11 @@ This guide provides a comprehensive reference for using the `gpt_context` tool.
|
|
9
9
|
### Common Options
|
10
10
|
- **`-i` or `--include`**: Specify patterns or files to include (multiple entries allowed).
|
11
11
|
- **`-e` or `--exclude`**: Specify patterns or files to exclude (multiple entries allowed).
|
12
|
-
- **`-f` or `--format`**: Define output format (`content`, `tree`, or `json`). If not provided, then `tree` followed by `content` is used by
|
13
|
-
- **`-d` or `--debug`**: Enable debug mode (e.g., `info`, `params`, `debug`). The default is `info` and this is how output to console is invoked. (Yes I know, it should be part of the
|
14
|
-
- **`-o` or `--output`**: Set the output target (`clipboard` or a file path). The default is `clipboard
|
12
|
+
- **`-f` or `--format`**: Define output format (`content`, `tree`, or `json`). If not provided, then `tree` followed by `content` is used by default.
|
13
|
+
- **`-d` or `--debug`**: Enable debug mode (e.g., `info`, `params`, `debug`). The default is `info` and this is how output to console is invoked. (Yes, I know, it should be part of the `--output` option as well).
|
14
|
+
- **`-o` or `--output`**: Set the output target (`clipboard` or a file path). The default is `clipboard` (I know this is potentially destructive).
|
15
15
|
- **`-l` or `--line-limit`**: Limit the number of lines included from each file.
|
16
|
-
- **`-b` or `--base-dir`**: Set the base directory to gather files from. Current working directory is used if not supplied
|
16
|
+
- **`-b` or `--base-dir`**: Set the base directory to gather files from. Current working directory is used if not supplied.
|
17
17
|
|
18
18
|
## Usage Examples
|
19
19
|
|
@@ -23,7 +23,7 @@ To gather the content of specific files and print it to the console, you can use
|
|
23
23
|
```sh
|
24
24
|
$ gpt_context -i "**/gpt_context.rb" -i "**/gpt_context/*.rb" -d -f content
|
25
25
|
```
|
26
|
-
**Explanation**: This command collects the content of all Ruby files matching the specified patterns (`gpt_context.rb` and files in the `gpt_context` directory). It includes debug output (`-d`) to log the content to the console during execution. The is stored in the clipboard in content format.
|
26
|
+
**Explanation**: This command collects the content of all Ruby files matching the specified patterns (`gpt_context.rb` and files in the `gpt_context` directory). It includes debug output (`-d`) to log the content to the console during execution. The result is stored in the clipboard in content format.
|
27
27
|
|
28
28
|
### 2. Displaying Directory Structure as a Tree
|
29
29
|
To visualize the structure of the included files as a tree, use the `-f tree` option:
|
@@ -39,7 +39,7 @@ You can export the gathered file data as JSON by using the `-f json` format opti
|
|
39
39
|
```sh
|
40
40
|
$ gpt_context -i "**/gpt_context.rb" -i "**/gpt_context/*.rb" -f json -o somefile.json
|
41
41
|
```
|
42
|
-
**Explanation**: This command collects files and outputs the gathered data in JSON format. The result is saved to `somefile.json` (`-o somefile.json`). There is no `-d` so there will be no console output
|
42
|
+
**Explanation**: This command collects files and outputs the gathered data in JSON format. The result is saved to `somefile.json` (`-o somefile.json`). There is no `-d` so there will be no console output; also, the `-o` will replace the default which is `clipboard` and so the only output in this case is the file which will go into the working directory. This is helpful when you need a structured representation of your project files, such as for further processing or analysis.
|
43
43
|
|
44
44
|
### 4. Combining Multiple Formats
|
45
45
|
You can generate multiple formats at once by specifying them in a comma-separated list:
|
@@ -47,7 +47,7 @@ You can generate multiple formats at once by specifying them in a comma-separate
|
|
47
47
|
```sh
|
48
48
|
$ gpt_context -i "**/gpt_context.rb" -i "**/gpt_context/*.rb" -f tree,content
|
49
49
|
```
|
50
|
-
**Explanation**: This command gathers the files and produces both a tree view and concatenated content output. The combined output can help visualize both the structure and content of your project files. This would be the default if you did not use `-f`, but
|
50
|
+
**Explanation**: This command gathers the files and produces both a tree view and concatenated content output. The combined output can help visualize both the structure and content of your project files. This would be the default if you did not use `-f`, but interestingly, you can reverse them `-f content,tree` if you want the tree at the bottom of the concatenated output.
|
51
51
|
|
52
52
|
### 5. Limiting the Number of Lines Collected
|
53
53
|
To limit the number of lines collected from each file, use the `-l` option:
|
@@ -91,6 +91,105 @@ The `gpt_context` tool is versatile for gathering, visualizing, and exporting pr
|
|
91
91
|
|
92
92
|
Feel free to expand this guide with more examples as you explore new ways to use `gpt_context`!
|
93
93
|
|
94
|
+
## Class-Level Usage Examples
|
95
|
+
|
96
|
+
In addition to the command line interface, the `gpt_context` tool provides classes that can be used directly in Ruby code for greater flexibility. Here are some examples of how to use the main classes involved in `gpt_context`.
|
97
|
+
|
98
|
+
### 1. Using `FileCollector`
|
99
|
+
The `FileCollector` class can be used to gather files programmatically. Below is an example of how to instantiate and use the `FileCollector` class.
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
require 'appydave/tools'
|
103
|
+
|
104
|
+
# Set up options for FileCollector
|
105
|
+
options = Appydave::Tools::GptContext::Options.new(
|
106
|
+
include_patterns: ['**/*.rb'],
|
107
|
+
exclude_patterns: ['spec/**/*'],
|
108
|
+
format: 'content',
|
109
|
+
line_limit: 20,
|
110
|
+
working_directory: Dir.pwd
|
111
|
+
)
|
112
|
+
|
113
|
+
# Create a new FileCollector instance
|
114
|
+
collector = Appydave::Tools::GptContext::FileCollector.new(options)
|
115
|
+
|
116
|
+
# Gather the file content
|
117
|
+
content = collector.build
|
118
|
+
|
119
|
+
# Output the collected content
|
120
|
+
puts content
|
121
|
+
```
|
122
|
+
**Explanation**: This script sets up `Options` with specific parameters (including which files to include/exclude and the format), and then creates a `FileCollector` instance to gather the content. The gathered content is printed to the console.
|
123
|
+
|
124
|
+
### 2. Setting Up `Options`
|
125
|
+
The `Options` class is crucial for configuring how the `FileCollector` behaves. Here’s how you can use the `Options` class:
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
require 'appydave/tools'
|
129
|
+
|
130
|
+
# Create options with specific settings
|
131
|
+
options = Appydave::Tools::GptContext::Options.new(
|
132
|
+
include_patterns: ['lib/**/*.rb'],
|
133
|
+
exclude_patterns: ['lib/excluded/**/*.rb'],
|
134
|
+
format: 'tree,content',
|
135
|
+
line_limit: 10,
|
136
|
+
debug: 'info',
|
137
|
+
output_target: ['clipboard'],
|
138
|
+
working_directory: 'lib'
|
139
|
+
)
|
140
|
+
|
141
|
+
# Display options
|
142
|
+
pp options
|
143
|
+
```
|
144
|
+
**Explanation**: The `Options` class provides named parameters to specify how files should be gathered. This script creates an `Options` instance, which can then be used by `FileCollector` or other components of the tool.
|
145
|
+
|
146
|
+
### 3. Using `OutputHandler`
|
147
|
+
The `OutputHandler` class is responsible for handling the output after files are gathered. Here is how to use it:
|
148
|
+
|
149
|
+
```ruby
|
150
|
+
require 'appydave/tools'
|
151
|
+
|
152
|
+
# Create options and gather content using FileCollector
|
153
|
+
options = Appydave::Tools::GptContext::Options.new(
|
154
|
+
include_patterns: ['**/*.rb'],
|
155
|
+
format: 'content',
|
156
|
+
output_target: ['output.txt']
|
157
|
+
)
|
158
|
+
|
159
|
+
collector = Appydave::Tools::GptContext::FileCollector.new(options)
|
160
|
+
content = collector.build
|
161
|
+
|
162
|
+
# Handle output using OutputHandler
|
163
|
+
output_handler = Appydave::Tools::GptContext::OutputHandler.new(content, options)
|
164
|
+
output_handler.execute
|
165
|
+
```
|
166
|
+
**Explanation**: This script collects content using `FileCollector` and then uses `OutputHandler` to save the gathered content to `output.txt`. The `OutputHandler` manages different output targets, such as clipboard or files, based on the specified options.
|
167
|
+
|
168
|
+
### 4. Combining Classes for Complete Workflow
|
169
|
+
Here’s an example of combining `Options`, `FileCollector`, and `OutputHandler` to automate the entire workflow:
|
170
|
+
|
171
|
+
```ruby
|
172
|
+
require 'appydave/tools'
|
173
|
+
|
174
|
+
# Step 1: Create Options
|
175
|
+
options = Appydave::Tools::GptContext::Options.new(
|
176
|
+
include_patterns: ['**/*.rb'],
|
177
|
+
exclude_patterns: ['**/test/**/*.rb'],
|
178
|
+
format: 'json',
|
179
|
+
output_target: ['output.json'],
|
180
|
+
debug: 'params'
|
181
|
+
)
|
182
|
+
|
183
|
+
# Step 2: Gather Files using FileCollector
|
184
|
+
collector = Appydave::Tools::GptContext::FileCollector.new(options)
|
185
|
+
content = collector.build
|
186
|
+
|
187
|
+
# Step 3: Output Results using OutputHandler
|
188
|
+
output_handler = Appydave::Tools::GptContext::OutputHandler.new(content, options)
|
189
|
+
output_handler.execute
|
190
|
+
```
|
191
|
+
**Explanation**: This complete example demonstrates how to use `Options` to configure the gathering process, `FileCollector` to collect the files, and `OutputHandler` to manage the output. This approach can be useful for programmatically automating context collection tasks in more complex workflows.
|
192
|
+
|
94
193
|
## References
|
95
194
|
|
96
195
|
- [ChatGPT Documentation](https://chatgpt.com/c/670f2150-08b4-8002-b2d7-04aff6fe304f)
|
@@ -1,6 +1,11 @@
|
|
1
1
|
# Subtitle Master
|
2
2
|
|
3
|
-
|
3
|
+
Older Chat
|
4
|
+
- https://chatgpt.com/c/f80dfca5-8168-4561-b5c6-8efed8672a88
|
5
|
+
|
6
|
+
New Features
|
7
|
+
- https://chatgpt.com/c/670470b8-a0c4-8002-9678-d4d69c680481
|
8
|
+
|
4
9
|
|
5
10
|
## SubtitleMaster - Clean Component
|
6
11
|
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "appydave-tools",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.3",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "appydave-tools",
|
9
|
-
"version": "0.11.
|
9
|
+
"version": "0.11.3",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.3",
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appydave-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -211,6 +211,7 @@ files:
|
|
211
211
|
- lib/appydave/tools/youtube_manager/reports/video_details_report.rb
|
212
212
|
- lib/appydave/tools/youtube_manager/update_video.rb
|
213
213
|
- lib/appydave/tools/youtube_manager/youtube_base.rb
|
214
|
+
- lib/appydave_tools.rb
|
214
215
|
- package-lock.json
|
215
216
|
- package.json
|
216
217
|
- sig/appydave/tools.rbs
|