context_spook 0.0.1 → 0.1.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 +1 -1
- data/context_spook.gemspec +3 -3
- data/contexts/project.rb +5 -1
- data/hello_world.json +3 -0
- data/lib/context_spook/generator.rb +23 -0
- data/lib/context_spook/version.rb +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: 8061fffaf039f19b3b37a0df7ce5ce62624c04c303fd525a6b2a96b74bbf0fd4
|
4
|
+
data.tar.gz: 72b878f810bd5695aa0a09144fb3eb66475d7e12d73ba1cd1b17694e54a89c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5f21ce7d81d9488732ebbe27e2b17096fa6c92afcd2e9dadf0427cad36a33eb48e4e114a7bd687a0fb60a37351297b8cbbcc035e4a6644c530a3007ee2aedc3
|
7
|
+
data.tar.gz: 38bc4a4e00193b70fce74115e8ba8d230dbb06d3c6179cebb1c889b83fb10310fe3d9699f8bbc26ef4d16fbd9c646c080274ea738e56d94fe08381250c7c1a96
|
data/README.md
CHANGED
data/context_spook.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: context_spook 0.0
|
2
|
+
# stub: context_spook 0.1.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "context_spook".freeze
|
6
|
-
s.version = "0.0
|
6
|
+
s.version = "0.1.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]
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["context_spook".freeze]
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/context_spook.rb".freeze, "lib/context_spook/generator.rb".freeze, "lib/context_spook/version.rb".freeze]
|
16
|
-
s.files = ["Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/context_spook".freeze, "context_spook.gemspec".freeze, "contexts/project.rb".freeze, "lib/context_spook.rb".freeze, "lib/context_spook/generator.rb".freeze, "lib/context_spook/version.rb".freeze, "spec/context_spook/generator_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
16
|
+
s.files = ["Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/context_spook".freeze, "context_spook.gemspec".freeze, "contexts/project.rb".freeze, "hello_world.json".freeze, "lib/context_spook.rb".freeze, "lib/context_spook/generator.rb".freeze, "lib/context_spook/version.rb".freeze, "spec/context_spook/generator_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
17
17
|
s.homepage = "https://github.com/flori/context_spook".freeze
|
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]
|
data/contexts/project.rb
CHANGED
@@ -35,5 +35,9 @@ context do
|
|
35
35
|
|
36
36
|
meta ruby: RUBY_DESCRIPTION
|
37
37
|
|
38
|
-
meta
|
38
|
+
meta hello_world: json('hello_world.json')
|
39
|
+
|
40
|
+
meta nixda_json: json('nixda_json.json')
|
41
|
+
|
42
|
+
meta code_coverage: json('coverage/coverage_context.json')
|
39
43
|
end
|
data/hello_world.json
ADDED
@@ -117,6 +117,29 @@ module ContextSpook
|
|
117
117
|
nil
|
118
118
|
end
|
119
119
|
|
120
|
+
# The json method reads and parses a JSON file, returning the parsed data
|
121
|
+
# structure.
|
122
|
+
#
|
123
|
+
# This method attempts to load a JSON file from the specified path and
|
124
|
+
# returns the resulting Ruby data structure. It provides verbose output
|
125
|
+
# about the file size when successfully reading the file. In case of file
|
126
|
+
# not found errors, it outputs a colored warning message to standard
|
127
|
+
# error and returns nil.
|
128
|
+
#
|
129
|
+
# @param filename [ String ] the path to the JSON file to be read and parsed
|
130
|
+
#
|
131
|
+
# @return [ Object, nil ] the parsed JSON data structure or nil if the file cannot be read
|
132
|
+
def json(filename)
|
133
|
+
file_size = Tins::Unit.format(
|
134
|
+
File.size(filename), format: '%.2f %U', unit: ?b, prefix: 1024
|
135
|
+
)
|
136
|
+
STDERR.puts "Read #{filename.inspect} as JSON (%s) for context." % file_size
|
137
|
+
JSON.load_file(filename)
|
138
|
+
rescue Errno::ENOENT => e
|
139
|
+
STDERR.puts color(208) { "Reading #{filename.inspect} as JSON caused #{e.class}: #{e}" }
|
140
|
+
nil
|
141
|
+
end
|
142
|
+
|
120
143
|
# The files method sets up a DSL accessor for providing files.
|
121
144
|
#
|
122
145
|
# @param default [ Hash ] the default files hash
|
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.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- bin/context_spook
|
142
142
|
- context_spook.gemspec
|
143
143
|
- contexts/project.rb
|
144
|
+
- hello_world.json
|
144
145
|
- lib/context_spook.rb
|
145
146
|
- lib/context_spook/generator.rb
|
146
147
|
- lib/context_spook/version.rb
|