appydave-tools 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eee6c36595a4e874d3c74f65698ca89d68f8c324a4d0482fa77f8f53de8a3029
4
- data.tar.gz: 744aaa75b3c1ec2dc9ac065b2931fcdef45b4ad713bcbb5771d3fef96de10bbd
3
+ metadata.gz: ff3f53496b7bcef356d2b26a3983b9edc374e7f8f1e51e8568eb046c92ffd8f5
4
+ data.tar.gz: 49d5940949d4f12c23a4da97e005ece228ede5ed4fa3143b9ffe276748da6f3a
5
5
  SHA512:
6
- metadata.gz: ce5e8b078060a8f548c350bfcad02efce169c3d8922f1177656ed76df44adbaac99ba1712a2247f3f1af6eb1a819c6a5ff0e4b1d46a02709d2ff972cd4f22ae1
7
- data.tar.gz: aa8422a814f69703c3444ace26576eda05c1777d81eb15178582331ec0b60bab47d89918debb31d4a4707ea7a6bf69186a17c05e2c7faacd414fa5b668b06c1d
6
+ metadata.gz: ad766554742121c77732c469de4789595585143ffc91e5671211ec00bc00aaafd578bfe3f27180ebc41d37e88a2bc8450efe99a5d869a5433095165d2ffd239a
7
+ data.tar.gz: 3248e609f4f6749e432c61fc26f56dc350c0991c9f25aa416d0124660c095a2366ee3432fdb07155c3c1b3b0a64a71753826e0a9128dff4e10efe3b9bf806ec4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.11.1](https://github.com/klueless-io/appydave-tools/compare/v0.11.0...v0.11.1) (2024-10-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * gpt context documentation ([808fccd](https://github.com/klueless-io/appydave-tools/commit/808fccdea10c472522da02c8af7f9a2c9eaf361a))
7
+
1
8
  # [0.11.0](https://github.com/klueless-io/appydave-tools/compare/v0.10.4...v0.11.0) (2024-10-16)
2
9
 
3
10
 
@@ -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 defaultboth are 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 desctructive.
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, 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.
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 interestling you can reverse them `-f content,tree` if you want the tree at the bottom of the concatenated output.
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
- [ChatGPT](https://chatgpt.com/c/f80dfca5-8168-4561-b5c6-8efed8672a88)
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.11.1'
5
+ VERSION = '0.11.2'
6
6
  end
7
7
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appydave-tools",
9
- "version": "0.11.1",
9
+ "version": "0.11.2",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
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.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys