context_spook 0.2.0 → 0.3.0
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 +6 -6
- data/Rakefile +6 -5
- data/context_spook.gemspec +4 -3
- data/lib/context_spook/generator.rb +2 -0
- data/lib/context_spook/version.rb +1 -1
- data/spec/context_spook/generator_spec.rb +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f52806b7e9dbd38070ca282415d5e05df58824be37f36389e6d7d820030e864c
|
4
|
+
data.tar.gz: 91a2f4016d0affe3d5e0105cbd456dcc73b6a23c580b85909cfcc2190cb195ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b2facc2b87f0e3a880b45eeee25e0155baf713f461531343ce4906ce5e6f51a153789def95c4b1741b11f468db7c7d6a7698c8e6dda858f14811e6fd85255f7
|
7
|
+
data.tar.gz: ae47a38687a3911af559d39229ee48abaed1970abd124401d20f3bf8392c7790a765793d9ec5e25ab0c5460e7c41f1ac52f1377827e3414baf5815688fb18fb6
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ be exported as structured JSON data.
|
|
8
8
|
The DSL is general-purpose and can be used for any kind of project or
|
9
9
|
collection of files, whether software development, documentation, research
|
10
10
|
data, educational materials, creative projects, or any other type of organized
|
11
|
-
information. The
|
11
|
+
information. The `.contexts/project.rb` example below demonstrates how to
|
12
12
|
describe a Ruby project, but the same principles apply across many different
|
13
13
|
domains.
|
14
14
|
|
@@ -71,10 +71,10 @@ File.write 'context.json', context.to_json
|
|
71
71
|
|
72
72
|
#### From a context definition file
|
73
73
|
|
74
|
-
Alternatively store the block's content above to a file
|
74
|
+
Alternatively store the block's content above to a file `.contexts/project.rb`:
|
75
75
|
|
76
76
|
```ruby
|
77
|
-
# contexts/project.rb
|
77
|
+
# .contexts/project.rb
|
78
78
|
context do
|
79
79
|
variable branch: `git rev-parse --abbrev-ref HEAD`.chomp
|
80
80
|
|
@@ -114,7 +114,7 @@ Now you can generate the context from the file, and store it as JSON in Ruby or
|
|
114
114
|
send it to another application.
|
115
115
|
|
116
116
|
```ruby
|
117
|
-
context = ContextSpook::generate_context('contexts/project.rb')
|
117
|
+
context = ContextSpook::generate_context('.contexts/project.rb')
|
118
118
|
File.write 'context.json', context.to_json
|
119
119
|
```
|
120
120
|
|
@@ -123,13 +123,13 @@ File.write 'context.json', context.to_json
|
|
123
123
|
Generate context and save to file:
|
124
124
|
|
125
125
|
```bash
|
126
|
-
./bin/context_spook contexts/project.rb > context.json
|
126
|
+
./bin/context_spook .contexts/project.rb > context.json
|
127
127
|
```
|
128
128
|
|
129
129
|
Or pipe directly to another tool:
|
130
130
|
|
131
131
|
```
|
132
|
-
./bin/context_spook contexts/project.rb | ollama_chat_send
|
132
|
+
./bin/context_spook .contexts/project.rb | ollama_chat_send
|
133
133
|
```
|
134
134
|
|
135
135
|
You will see two orange warning messages, that demonstrates how errors like
|
data/Rakefile
CHANGED
@@ -19,9 +19,9 @@ GemHadar do
|
|
19
19
|
test_dir 'spec'
|
20
20
|
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.bundle',
|
21
21
|
'.yardoc', 'doc', 'tags', 'errors.lst', 'cscope.out', 'coverage', 'tmp',
|
22
|
-
'yard'
|
22
|
+
'yard', 'TODO.md'
|
23
23
|
package_ignore '.all_images.yml', '.tool-versions', '.gitignore', 'VERSION',
|
24
|
-
'.rspec',
|
24
|
+
'.rspec', '.github'
|
25
25
|
readme 'README.md'
|
26
26
|
|
27
27
|
required_ruby_version '~> 3.1'
|
@@ -29,9 +29,10 @@ GemHadar do
|
|
29
29
|
dependency 'tins', '~>1.39'
|
30
30
|
dependency 'json', '~>2.0'
|
31
31
|
dependency 'term-ansicolor', '~> 1.11'
|
32
|
-
dependency
|
33
|
-
|
34
|
-
development_dependency '
|
32
|
+
dependency 'mize', '~> 0.6'
|
33
|
+
dependency 'mime-types', '~> 3.0'
|
34
|
+
development_dependency 'all_images', '~> 0.6'
|
35
|
+
development_dependency 'rspec', '~> 3.2'
|
35
36
|
development_dependency 'debug'
|
36
37
|
development_dependency 'simplecov'
|
37
38
|
|
data/context_spook.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: context_spook 0.
|
2
|
+
# stub: context_spook 0.3.0 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 = "0.3.0".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]
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.specification_version = 4
|
26
26
|
|
27
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.
|
27
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.1".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])
|
@@ -33,4 +33,5 @@ Gem::Specification.new do |s|
|
|
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
|
+
s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
|
36
37
|
end
|
@@ -2,6 +2,7 @@ require 'tins/xt'
|
|
2
2
|
require 'term/ansicolor'
|
3
3
|
require 'json'
|
4
4
|
require 'mize'
|
5
|
+
require 'mime-types'
|
5
6
|
|
6
7
|
# The ContextSpook module serves as a namespace container for collecting and
|
7
8
|
# organizing project information for AI assistance.
|
@@ -186,6 +187,7 @@ module ContextSpook
|
|
186
187
|
content:,
|
187
188
|
size: content.size,
|
188
189
|
lines: content.lines.size,
|
190
|
+
content_types: MIME::Types.type_for(filename).map(&:content_type).full?,
|
189
191
|
tags: (Array(tags) if tags),
|
190
192
|
}.compact
|
191
193
|
file_size = Tins::Unit.format(
|
@@ -53,6 +53,7 @@ describe ContextSpook::Generator do
|
|
53
53
|
file = context.files['lib/context_spook.rb']
|
54
54
|
expect(file).to be_present
|
55
55
|
expect(file[:content]).to be_present
|
56
|
+
expect(file[:content_types]).to be_present
|
56
57
|
expect(file[:size]).to be > 0
|
57
58
|
expect(file[:lines]).to be > 0
|
58
59
|
expect(file[:namespace]).to eq :lib
|
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: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '2.
|
18
|
+
version: '2.1'
|
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: '2.
|
25
|
+
version: '2.1'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: all_images
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,6 +135,20 @@ dependencies:
|
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0.6'
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: mime-types
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '3.0'
|
145
|
+
type: :runtime
|
146
|
+
prerelease: false
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '3.0'
|
138
152
|
description: |
|
139
153
|
context_spook is a library that collects and organizes project
|
140
154
|
information to help AI assistants understand codebases better.
|