context_spook 0.9.0 → 1.0.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 +4 -4
- data/README.md +7 -10
- data/bin/context_spook +18 -26
- data/context_spook.gemspec +4 -4
- data/lib/context_spook/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94058fa45fd85552ea4e54d5f67d991d90d7d29a8a344490c71942a568032755
|
|
4
|
+
data.tar.gz: a12296d4822f6cc01294ecc8c6bb3d544f894eebcaaaddc83956420b33c28c56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9f81bb6d859590f83b7febf9dbfeac3223da9624d4d6851204ad5e255b22dcff2db3d4c0eb4c741228edaac07a23565ab56abe9946b2e8b9059973c6f82de2e
|
|
7
|
+
data.tar.gz: 3439f27cac24f0d78e3a3fa99586d6d20aa9b3a33ebe4892a2757614c27eaba9073cffeb5da81d5502c5e245d8c38c282e6964656227e24e42d90a512ea686b7
|
data/README.md
CHANGED
|
@@ -153,23 +153,20 @@ The CLI tool also supports file redirection:
|
|
|
153
153
|
./bin/context_spook .contexts/project.rb -o context.json
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
You can also use
|
|
156
|
+
You can also use include patterns to automatically collect files without
|
|
157
157
|
manually specifying each one:
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
160
|
# Collect all Ruby files from lib/ and spec/ directories
|
|
161
|
-
./bin/context_spook -
|
|
161
|
+
./bin/context_spook -i 'lib/**/*.rb' -i 'spec/**/*.rb'
|
|
162
162
|
|
|
163
163
|
# Collect Markdown and YAML files from current directory
|
|
164
|
-
./bin/context_spook -
|
|
164
|
+
./bin/context_spook -i '*.md' -i '*.yaml' -i '*.yml'
|
|
165
165
|
|
|
166
|
-
#
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
./bin/context_spook -
|
|
170
|
-
|
|
171
|
-
# Same result using default -s suffix all
|
|
172
|
-
./bin/context_spook -d lib:rb -d bin
|
|
166
|
+
# Collect files with complex patterns
|
|
167
|
+
./bin/context_spook -i 'lib/**/{*.rb,*.rake}' # Brace expansion
|
|
168
|
+
./bin/context_spook -i 'lib/**/*_spec.rb' # Pattern matching
|
|
169
|
+
./bin/context_spook -i 'lib/**/*.rb' -i 'spec/**/*_spec.rb' # Mixed patterns
|
|
173
170
|
```
|
|
174
171
|
|
|
175
172
|
This is how you can show the usage message:
|
data/bin/context_spook
CHANGED
|
@@ -24,52 +24,43 @@ def usage
|
|
|
24
24
|
-o FILE Write output to FILE instead of stdout
|
|
25
25
|
~v Disable verbose output, enabled by default
|
|
26
26
|
-h Show this help message
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
otherwise the -s argument value is used.
|
|
30
|
-
-s SUFFIX File suffix to include, defaults to all
|
|
27
|
+
-i PATTERN Include files matching PATTERN (can be used multiple times)
|
|
28
|
+
Supports glob patterns like **, *, ?, [abc], {a,b,c}
|
|
31
29
|
|
|
32
30
|
Examples:
|
|
33
31
|
# Generate context and output to stdout
|
|
34
32
|
#{File.basename($0)} .contexts/project.rb
|
|
35
33
|
|
|
36
|
-
# Generate context
|
|
37
|
-
#{File.basename($0)} -
|
|
34
|
+
# Generate context with include patterns
|
|
35
|
+
#{File.basename($0)} -i 'lib/**/*.rb'
|
|
36
|
+
#{File.basename($0)} -i 'lib/**/*.rb' -i 'spec/**/*.rb'
|
|
37
|
+
#{File.basename($0)} -i 'lib/**/*.rb' -i 'lib/**/*.js'
|
|
38
|
+
|
|
39
|
+
# Complex glob patterns
|
|
40
|
+
#{File.basename($0)} -i 'lib/**/{*.rb,*.rake}' # Brace expansion
|
|
41
|
+
#{File.basename($0)} -i 'lib/**/*_spec.rb' # Pattern matching
|
|
42
|
+
#{File.basename($0)} -i 'lib/**/*.rb' -i 'spec/**/*_spec.rb' # Mixed patterns
|
|
38
43
|
|
|
39
44
|
# Generate context without verbose output
|
|
40
45
|
#{File.basename($0)} .contexts/project.rb ~v
|
|
41
46
|
|
|
42
47
|
# Generate context and save to file
|
|
43
48
|
#{File.basename($0)} .contexts/project.rb -o context.json
|
|
44
|
-
|
|
45
|
-
# Generate context from directory globs and save to file
|
|
46
|
-
#{File.basename($0)} -d lib -d spec -s rb -o context.json
|
|
47
|
-
|
|
48
|
-
# Generate context with explicit suffix hints
|
|
49
|
-
# -d lib:rb collects only .rb files from lib/
|
|
50
|
-
# -d bin:all collects all files from bin/ (no suffix filtering)
|
|
51
|
-
#{File.basename($0)} -d lib:rb -d bin:all
|
|
52
|
-
|
|
53
|
-
# Same result using default -s suffix all
|
|
54
|
-
#{File.basename($0)} -d lib:rb -d bin
|
|
55
49
|
EOT
|
|
56
50
|
exit 0
|
|
57
51
|
end
|
|
58
52
|
|
|
59
|
-
opts = go '
|
|
53
|
+
opts = go 'o:i:pvh', defaults: { ?v => true }
|
|
60
54
|
opts[?h] and usage
|
|
61
55
|
context = nil
|
|
62
56
|
output = nil
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
|
|
58
|
+
if opts[?i]
|
|
65
59
|
context = ContextSpook.generate_context(verbose: opts[?v]) do
|
|
66
60
|
context do
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
dir = Pathname.new(dir).expand_path
|
|
71
|
-
dir_glob = dir + (suffix == 'all' ? '**/*' : "**/*.#{suffix}")
|
|
72
|
-
Dir[dir_glob].each do |filename|
|
|
61
|
+
opts[?i].to_a.each do |glob|
|
|
62
|
+
glob = File.expand_path(glob)
|
|
63
|
+
Dir.glob(glob).each do |filename|
|
|
73
64
|
Pathname.new(filename).file? or next
|
|
74
65
|
file filename
|
|
75
66
|
end
|
|
@@ -80,6 +71,7 @@ else
|
|
|
80
71
|
filename = ARGV.shift or fail 'require context definition file as an argument'
|
|
81
72
|
context = ContextSpook.generate_context(filename, verbose: opts[?v])
|
|
82
73
|
end
|
|
74
|
+
|
|
83
75
|
if output_filename = opts[?o]
|
|
84
76
|
if File.exist?(output_filename)
|
|
85
77
|
fail "Filename #{output_filename.inspect} already exists!"
|
data/context_spook.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: context_spook 0.
|
|
2
|
+
# stub: context_spook 1.0.1 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "context_spook".freeze
|
|
6
|
-
s.version = "0.
|
|
6
|
+
s.version = "1.0.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]
|
|
@@ -18,13 +18,13 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.licenses = ["MIT".freeze]
|
|
19
19
|
s.rdoc_options = ["--title".freeze, "ContextSpook - context_spook collects project context for AI".freeze, "--main".freeze, "README.md".freeze]
|
|
20
20
|
s.required_ruby_version = Gem::Requirement.new(">= 3.1".freeze)
|
|
21
|
-
s.rubygems_version = "4.0.
|
|
21
|
+
s.rubygems_version = "4.0.3".freeze
|
|
22
22
|
s.summary = "context_spook collects project context for AI".freeze
|
|
23
23
|
s.test_files = ["spec/context_spook/generator_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
|
24
24
|
|
|
25
25
|
s.specification_version = 4
|
|
26
26
|
|
|
27
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["
|
|
27
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.16.2".freeze])
|
|
28
28
|
s.add_development_dependency(%q<all_images>.freeze, ["~> 0.6".freeze])
|
|
29
29
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
|
|
30
30
|
s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
|
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.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -13,16 +13,16 @@ dependencies:
|
|
|
13
13
|
name: gem_hadar
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 2.16.2
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
|
-
- - "
|
|
23
|
+
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 2.16.2
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: all_images
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
226
226
|
- !ruby/object:Gem::Version
|
|
227
227
|
version: '0'
|
|
228
228
|
requirements: []
|
|
229
|
-
rubygems_version: 4.0.
|
|
229
|
+
rubygems_version: 4.0.3
|
|
230
230
|
specification_version: 4
|
|
231
231
|
summary: context_spook collects project context for AI
|
|
232
232
|
test_files:
|