context_spook 0.6.1 → 0.7.1

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: 58670ead7c97c0681f39da47670f4afeb1ac08d1dc3ab8ddcb740fa2bf679a00
4
- data.tar.gz: 48db4e54b8a5bbdfe2dcd3e58196d0f42801ada41668d4e43338adb68a9acd82
3
+ metadata.gz: 9ba5ed78117075d6742c646d759dd08152f967b0482e01a732ef44eea965fa44
4
+ data.tar.gz: 7714e9ca69a6fbbc454f400927ca40c86bedad4df79f5ca154696edc29f98ea6
5
5
  SHA512:
6
- metadata.gz: c6f4d3fc5143082767f5bd361575a130d37710eeeb36965a2d5cb578ddcea5716047b17f6220d4a2a82ad857685d58dae7ae77e53bb355f1c7e54807b941b0d8
7
- data.tar.gz: e50fe54b405153348f1936023c81330b67bfe0f7dc620cf9d85cb929cb7558383c6a2ec65b37e4502a7fd5608ec8028935f56e229a4f9e0c4734948ce3176f77
6
+ metadata.gz: 272d7e1125b67b6f2de2a3360f420f393cbcaae4fd887182ad9de227f0d8317b272a7b309cbd745f340d1ffa435334a6b85144f9bbaf71b95903e207fda3cc2a
7
+ data.tar.gz: 79f9289ef65f0179bc5bbdb53fd7302c37a7ce7e6df4a41724ad290e3c369fced720fda80a3df60c9c410dd6b2607bb79486afe1bd9e96da19507cb79e9100e4
data/README.md CHANGED
@@ -154,6 +154,17 @@ The CLI tool also supports file redirection:
154
154
  ./bin/context_spook .contexts/project.rb -o context.json
155
155
  ```
156
156
 
157
+ You can also use directory globbing to automatically collect files without
158
+ manually specifying each one:
159
+
160
+ ```bash
161
+ # Collect all Ruby files from lib/ and spec/ directories
162
+ ./bin/context_spook -d lib -d spec -s rb
163
+
164
+ # Collect Markdown and YAML files from current directory
165
+ ./bin/context_spook -s md -s yaml
166
+ ```
167
+
157
168
  This is how you can show the usage message:
158
169
 
159
170
  ```
data/Rakefile CHANGED
@@ -31,12 +31,13 @@ GemHadar do
31
31
 
32
32
  required_ruby_version '~> 3.1'
33
33
 
34
- dependency 'tins', '~>1.39'
34
+ dependency 'tins', '~>1.46'
35
35
  dependency 'json', '~>2.0'
36
36
  dependency 'term-ansicolor', '~> 1.11'
37
37
  dependency 'mize', '~> 0.6'
38
38
  dependency 'mime-types', '~> 3.0'
39
39
  dependency 'yaml', '~> 0.4'
40
+ dependency 'pathname', '~> 0.4'
40
41
  development_dependency 'all_images', '~> 0.6'
41
42
  development_dependency 'rspec', '~> 3.2'
42
43
  development_dependency 'debug'
data/bin/context_spook CHANGED
@@ -4,6 +4,7 @@ require 'context_spook'
4
4
  require 'tins/go'
5
5
  include Tins::GO
6
6
  require 'json'
7
+ require 'pathname'
7
8
 
8
9
  # The usage method displays the command-line interface help text and example
9
10
  # usage patterns for the ContextSpook tool.
@@ -23,29 +24,55 @@ def usage
23
24
  -o FILE Write output to FILE instead of stdout
24
25
  -v Verbose output
25
26
  -h Show this help message
27
+ -d DIR Directory to search for files (defaults to current dir, can be
28
+ used multiple times)
29
+ -s SUFFIX File suffix to include (can be used multiple times)
26
30
 
27
31
  Examples:
28
32
  # Generate context and output to stdout
29
33
  #{File.basename($0)} .contexts/project.rb
30
34
 
31
- # Generate context and save to file
32
- #{File.basename($0)} .contexts/project.rb -o context.json
35
+ # Generate context from directory globs
36
+ #{File.basename($0)} -d lib -d spec -s rb
33
37
 
34
38
  # Generate context with verbose output
35
39
  #{File.basename($0)} .contexts/project.rb -v
36
40
 
37
- # Generate context and pipe to another tool
38
- #{File.basename($0)} .contexts/project.rb | ollama_chat_send
41
+ # Generate context from directory globs with verbose output
42
+ #{File.basename($0)} -d lib -d spec -s rb -v
43
+
44
+ # Generate context and save to file
45
+ #{File.basename($0)} .contexts/project.rb -o context.json
46
+
47
+ # Generate context from directory globs and save to file
48
+ #{File.basename($0)} -d lib -d spec -s rb -o context.json
39
49
 
40
50
  EOT
41
51
  exit 0
42
52
  end
43
53
 
44
- opts = go 'o:pvh'
54
+ opts = go 'd:s:o:pvh', defaults: { ?d => ?. }
45
55
  opts[?h] and usage
56
+ context = nil
57
+ output = nil
58
+ if opts[?s]
59
+ context = ContextSpook.generate_context(verbose: opts[?v]) do
60
+ context do
61
+ opts[?d].each do |d|
62
+ dir = Pathname.new(d).expand_path
63
+ opts[?s].each do |suffix|
64
+ dir_glob = dir + "**/*.#{suffix}"
65
+ Dir[dir_glob].each do |filename|
66
+ file filename
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ else
46
73
  filename = ARGV.shift or fail 'require context definition file as an argument'
47
- output = nil
48
- context = ContextSpook.generate_context(filename, verbose: opts[?v])
74
+ context = ContextSpook.generate_context(filename, verbose: opts[?v])
75
+ end
49
76
  if output_filename = opts[?o]
50
77
  if File.exist?(output_filename)
51
78
  fail "Filename #{output_filename.inspect} already exists!"
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: context_spook 0.6.1 ruby lib
2
+ # stub: context_spook 0.7.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "context_spook".freeze
6
- s.version = "0.6.1".freeze
6
+ s.version = "0.7.1".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -29,10 +29,11 @@ Gem::Specification.new do |s|
29
29
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
30
30
  s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
31
31
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
32
- s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.39".freeze])
32
+ s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.46".freeze])
33
33
  s.add_runtime_dependency(%q<json>.freeze, ["~> 2.0".freeze])
34
34
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
35
35
  s.add_runtime_dependency(%q<mize>.freeze, ["~> 0.6".freeze])
36
36
  s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
37
37
  s.add_runtime_dependency(%q<yaml>.freeze, ["~> 0.4".freeze])
38
+ s.add_runtime_dependency(%q<pathname>.freeze, ["~> 0.4".freeze])
38
39
  end
@@ -1,6 +1,6 @@
1
1
  module ContextSpook
2
2
  # ContextSpook version
3
- VERSION = '0.6.1'
3
+ VERSION = '0.7.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: context_spook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -85,14 +85,14 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.39'
88
+ version: '1.46'
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '1.39'
95
+ version: '1.46'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: json
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +163,20 @@ dependencies:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0.4'
166
+ - !ruby/object:Gem::Dependency
167
+ name: pathname
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '0.4'
173
+ type: :runtime
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.4'
166
180
  description: |
167
181
  context_spook is a library that collects and organizes project
168
182
  information to help AI assistants understand codebases better.