utils 0.71.0 → 0.72.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb43a2fb980621c39c8dd83850e3b7752d3b8b2697d169d155ee2d541e9d4649
4
- data.tar.gz: b804d7973f33d5ce1a8904d96d9b11b7e1560f73fd18facd6e0d1011de95b8a8
3
+ metadata.gz: '0669343d477b3b469c0856cf988d9526677ba181ef5d8786b7291fb8ec21da46'
4
+ data.tar.gz: cc6c96962eb22d3f6469aaa93bf092ebbddfc7ba7f30afb42e277b3c2cd142c0
5
5
  SHA512:
6
- metadata.gz: 6214647c846b302c6ae3a02f4c58dd1520a58e5d61f6f7b9a5060d90d16c8663eae861ae866c43f5e70c01e3794a8376efccdd942e282efeaa3e130ee83d418b
7
- data.tar.gz: 1a1e7c14221af1f4a72d0c94fa81915fd512378e62bd8981299e4ab697fb5a664c293387a96d368322ca75da30ac3f437dfb215c7a3bd45496100ae7f41ce602
6
+ metadata.gz: 9c88255d58409d2f1b6cd881d4d9164e6ab8ce7c3d6b6e52b8160e5d9cdfac5ba2a3a2a5f70ba1821c20a41b620e2249a4412bb36b3659b61ca0b407fc57ab8f
7
+ data.tar.gz: b805d2d08627a97127ff115e75a990384866c473695fc26178367e60b1f2b030947d5ae247f5fbcf809d4ccc2cc149b5339937fa534b33c48fabb42b55046d3d
data/bin/code_comment CHANGED
@@ -176,23 +176,30 @@ base_url = ENV['OLLAMA_URL'] || 'http://%s' % ENV.fetch('OLLAMA_HOST'
176
176
  model = ENV.fetch('OLLAMA_MODEL', 'llama3.1')
177
177
  construct, construct_type = fetch_construct(filename_linenumber)
178
178
  construct_indent = construct[/\A( *)/, 1].size
179
- context = if File.exist?(filename = 'contexts/code_comment.rb')
180
- ContextSpook.generate_context(filename)
179
+ context_filename = ENV.fetch(
180
+ 'CODE_COMMENT_CONTEXT_FILENAME', '.contexts/code_comment.rb'
181
+ )
182
+
183
+ default_context = ContextSpook.generate_context do
184
+ context do
185
+ file "README.md", tags: %w[ documentation ]
186
+
187
+ # Auto-discover files using globs
188
+ %w[ lib spec test ].each do |dir|
189
+ namespace dir do
190
+ Dir["#{dir}/**/*.rb"].each do |filename|
191
+ file filename, tags: %w[ ruby ]
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
197
+ context = if File.exist?(context_filename)
198
+ STDERR.puts "Using context from #{context_filename.inspect}."
199
+ ContextSpook.generate_context(context_filename)
181
200
  else
182
- ContextSpook.generate_context do
183
- context do
184
- file "README.md", tags: %w[ documentation ]
185
-
186
- # Auto-discover files using globs
187
- %w[ lib spec test ].each do |dir|
188
- namespace dir do
189
- Dir["#{dir}/**/*.rb"].each do |filename|
190
- file filename, tags: %w[ ruby ]
191
- end
192
- end
193
- end
194
- end
195
- end
201
+ STDERR.puts "Using inline default context."
202
+ default_context
196
203
  end.to_json
197
204
  #call_sites = %x(cscope -L -3 "#{method_name}" $(find . -name '*.rb') | awk '{ print $1 ":" $3 }').lines.map(&:chomp).uniq
198
205
  #methods = call_sites.map { fetch_method(_1) } * ?\n
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.71.0'
3
+ VERSION = '0.72.0'
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:
data/utils.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.71.0 ruby lib
2
+ # stub: utils 0.72.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.71.0".freeze
6
+ s.version = "0.72.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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.71.0
4
+ version: 0.72.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank