utils 0.74.0 → 0.76.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/.utilsrc +7 -2
- data/Rakefile +4 -2
- data/bin/code_comment +18 -14
- data/bin/code_indexer +15 -0
- data/bin/serve +11 -7
- data/lib/utils/config_file.rb +66 -39
- data/lib/utils/version.rb +1 -1
- data/utils.gemspec +7 -6
- metadata +21 -9
- data/bin/create_cstags +0 -48
- data/bin/create_tags +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a9477a08fc6208e5f08541548f114214e1e16d1541b54afd796a993f4bb797
|
4
|
+
data.tar.gz: 85f16bde757a26d38ddb7de7b5ffe8543a638966cec97e17c9c8fbbcfc4b5ab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f390d477492c50e7b048041642a72c1ce25303faa92586a6541eca418f5017650617023877bfb30195d0f47d702b76dc481b428398cc539b627a3dcf132c7d0d
|
7
|
+
data.tar.gz: edec6e1f40bcef944275643784dcea4992deee86bcfd962412e9175d9aa34ecbcdef9aab2400e81bc77a975b99a7714fb8d417196a3b53981280e666b38899a0
|
data/.utilsrc
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# vim: set ft=ruby:
|
2
2
|
|
3
3
|
search do
|
4
|
-
prune_dirs /\A(\.svn|\.git|\.terraform|CVS|tmp|coverage|corpus|pkg|\.yardoc)\z/
|
4
|
+
prune_dirs /\A(\.svn|\.git|\.terraform|CVS|tmp|coverage|corpus|pkg|\.yardoc|doc)\z/
|
5
5
|
skip_files /(\A\.|\.sw[pon]\z|\.(log|fnm|jpg|jpeg|png|pdf|svg)\z|\Atags\z|~\z)/i
|
6
6
|
end
|
7
7
|
|
8
8
|
discover do
|
9
|
-
prune_dirs /\A(\.svn|\.git|\.terraform|\.yardoc|CVS|tmp|coverage|corpus|pkg|\.yardoc)\z/
|
9
|
+
prune_dirs /\A(\.svn|\.git|\.terraform|\.yardoc|CVS|tmp|coverage|corpus|pkg|\.yardoc|doc)\z/
|
10
10
|
skip_files /(\A\.|\.sw[pon]\z|\.log\z|~\z)/
|
11
11
|
index_expire_after 3_600
|
12
12
|
end
|
@@ -31,3 +31,8 @@ end
|
|
31
31
|
classify do
|
32
32
|
shift_path_by_default 1
|
33
33
|
end
|
34
|
+
|
35
|
+
code_indexer do
|
36
|
+
verbose true
|
37
|
+
paths { [ 'lib' ] }
|
38
|
+
end
|
data/Rakefile
CHANGED
@@ -14,14 +14,15 @@ GemHadar do
|
|
14
14
|
map(&File.method(:basename))
|
15
15
|
test_dir 'tests'
|
16
16
|
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.rvmrc', '.AppleDouble',
|
17
|
-
'tags', '.bundle', '.DS_Store', '.byebug_history', '.yardoc', 'doc'
|
17
|
+
'tags', '.bundle', '.DS_Store', '.byebug_history', '.yardoc', 'doc',
|
18
|
+
'cscope.out', '.starscope.db'
|
18
19
|
package_ignore '.gitignore', 'VERSION'
|
19
20
|
readme 'README.md'
|
20
21
|
licenses << 'GPL-2.0'
|
21
22
|
|
22
23
|
dependency 'unix_socks'
|
23
24
|
dependency 'webrick'
|
24
|
-
dependency 'tins', '~> 1.
|
25
|
+
dependency 'tins', '~> 1.43'
|
25
26
|
dependency 'term-ansicolor', '~> 1.11'
|
26
27
|
dependency 'pstree', '~> 0.3'
|
27
28
|
dependency 'infobar', '~> 0.8'
|
@@ -31,6 +32,7 @@ GemHadar do
|
|
31
32
|
dependency 'ollama-ruby', '~> 1.6'
|
32
33
|
dependency 'kramdown-ansi', '~> 0.1'
|
33
34
|
dependency 'figlet', '~> 1.0'
|
35
|
+
dependency 'starscope'
|
34
36
|
dependency 'context_spook', '~> 0.2'
|
35
37
|
dependency 'simplecov'
|
36
38
|
dependency 'debug'
|
data/bin/code_comment
CHANGED
@@ -111,16 +111,18 @@ def build_method_prompt(construct_type, construct, context)
|
|
111
111
|
|
112
112
|
Format requirements:
|
113
113
|
|
114
|
-
1.
|
114
|
+
1. Focus on providing a description of the %{construct_type}'s purpose
|
115
115
|
without including any code snippets.
|
116
|
-
2. **
|
117
|
-
|
118
|
-
3. **
|
116
|
+
2. **Always** output just the line comments starting each with a single #
|
117
|
+
character.
|
118
|
+
3. **Never** output blank lines between comment lines that belong to the
|
119
|
+
same logical section
|
120
|
+
4. **Never** output any executable ruby code like class or module
|
119
121
|
definitions, or method definitions or other code outside of such
|
120
122
|
comments.
|
121
|
-
|
122
|
-
|
123
|
-
|
123
|
+
5. You should omit the @raise if you are not sure.
|
124
|
+
6. **Never** use `, `ruby, ```, ```ruby in your response.
|
125
|
+
7. **Never** add any other remarks or explanation to your response.
|
124
126
|
EOT
|
125
127
|
$config_dir.read('method-prompt.txt', default: default_prompt) % {
|
126
128
|
construct_type:, construct:, context:,
|
@@ -150,16 +152,18 @@ def build_class_module_prompt(construct_type, construct, context)
|
|
150
152
|
|
151
153
|
Format requirements:
|
152
154
|
|
153
|
-
1.
|
155
|
+
1. Focus on providing a description of the %{construct_type}'s purpose
|
154
156
|
without including any code snippets.
|
155
|
-
2. **
|
156
|
-
|
157
|
-
3. **
|
157
|
+
2. **Always** output just the line comments starting each with a single #
|
158
|
+
character.
|
159
|
+
3. **Never** output blank lines between comment lines that belong to the
|
160
|
+
same logical section
|
161
|
+
4. **Never** output any executable ruby code like class or module
|
158
162
|
definitions, or method definitions or other code outside of such
|
159
163
|
comments.
|
160
|
-
|
161
|
-
|
162
|
-
|
164
|
+
5. You should omit the @raise if you are not sure.
|
165
|
+
6. **Never** use `, `ruby, ```, ```ruby in your response.
|
166
|
+
7. **Never** add any other remarks or explanation to your response.
|
163
167
|
EOT
|
164
168
|
$config_dir.read('class-module-prompt.txt', default: default_prompt) % {
|
165
169
|
construct_type:, construct:, context:,
|
data/bin/code_indexer
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'utils'
|
4
|
+
config = Utils::ConfigFile.new
|
5
|
+
config.configure_from_paths
|
6
|
+
|
7
|
+
config.code_indexer.formats.each do |format, output|
|
8
|
+
paths = config.code_indexer.paths.grep_v(/Resolving dependencies/)
|
9
|
+
puts "Indexing code for #{format}…"
|
10
|
+
cmd = [ 'starscope', '-e', format, '-f', output, '--no-read' ]
|
11
|
+
config.code_indexer.verbose and cmd << '--verbose'
|
12
|
+
cmd.push(*paths)
|
13
|
+
system(*cmd)
|
14
|
+
puts "Done."
|
15
|
+
end
|
data/bin/serve
CHANGED
@@ -6,7 +6,7 @@ require 'tins/go'
|
|
6
6
|
include Tins::GO
|
7
7
|
require 'webrick'
|
8
8
|
|
9
|
-
$opts = go 'p:h'
|
9
|
+
$opts = go 'b:p:h', defaults: { ?b => '127.0.0.1', ?p => 8888 }
|
10
10
|
|
11
11
|
if $opts[?h]
|
12
12
|
puts <<~USAGE
|
@@ -15,12 +15,14 @@ if $opts[?h]
|
|
15
15
|
Usage: #{File.basename($0)} [OPTIONS] [DIR]
|
16
16
|
|
17
17
|
Options:
|
18
|
-
-
|
19
|
-
-
|
18
|
+
-b ADDRESS Address to bind to (default: "127.0.0.1")
|
19
|
+
-p PORT Specify port number (default: 8888)
|
20
|
+
-h Show this help message
|
20
21
|
|
21
22
|
Examples:
|
22
|
-
#{File.basename($0)} # Serve current directory on
|
23
|
-
#{File.basename($0)} -
|
23
|
+
#{File.basename($0)} # Serve current directory on 127.0.0.1:8888
|
24
|
+
#{File.basename($0)} -b 0.0.0.0 # Serve on 0.0.0.0:3000
|
25
|
+
#{File.basename($0)} -p 3000 # Serve on 127.0.0.1:3000
|
24
26
|
#{File.basename($0)} /path/to/dir # Serve specific directory
|
25
27
|
|
26
28
|
Note: If no directory is specified, serves the current working directory.
|
@@ -28,11 +30,13 @@ if $opts[?h]
|
|
28
30
|
exit
|
29
31
|
end
|
30
32
|
|
31
|
-
|
33
|
+
address = $opts[?b]
|
34
|
+
port = $opts[?p].to_i
|
32
35
|
s = WEBrick::HTTPServer.new(
|
36
|
+
BindAddress: address,
|
33
37
|
Port: port,
|
34
38
|
DocumentRoot: ARGV.shift || Dir.pwd
|
35
39
|
)
|
36
40
|
trap('INT') { s.shutdown }
|
37
|
-
puts "You have been served: http
|
41
|
+
puts "You have been served: http://#{address}:#{port}/"
|
38
42
|
s.start
|
data/lib/utils/config_file.rb
CHANGED
@@ -8,6 +8,11 @@ require 'tins'
|
|
8
8
|
# provide centralized configuration management.
|
9
9
|
class Utils::ConfigFile
|
10
10
|
class << self
|
11
|
+
|
12
|
+
# The config_file_paths accessor method provides read and write access to
|
13
|
+
# the config_file_paths instance variable.
|
14
|
+
#
|
15
|
+
# @return [ Array<String> ] the array of configuration file paths
|
11
16
|
attr_accessor :config_file_paths
|
12
17
|
end
|
13
18
|
self.config_file_paths = [
|
@@ -126,6 +131,27 @@ class Utils::ConfigFile
|
|
126
131
|
self
|
127
132
|
end
|
128
133
|
|
134
|
+
# The lazy_config method configures a lazy-loaded configuration option
|
135
|
+
# with a default value.
|
136
|
+
#
|
137
|
+
# This method registers a new configuration setting that will be
|
138
|
+
# initialized lazily, meaning the default value or the set value is only
|
139
|
+
# computed when the configuration is actually accessed. It adds the
|
140
|
+
# setting to the list of configuration settings and creates a lazy
|
141
|
+
# accessor for it.
|
142
|
+
#
|
143
|
+
# @param name [ Object ] the name of the configuration setting to define
|
144
|
+
# @yield [ default ] optional block that provides the default value for
|
145
|
+
# the configuration
|
146
|
+
#
|
147
|
+
# @return [ Object ] returns self to allow for method chaining
|
148
|
+
def lazy_config(name, &default)
|
149
|
+
self.config_settings ||= []
|
150
|
+
config_settings << name.to_sym
|
151
|
+
dsl_lazy_accessor(name, &default)
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
129
155
|
# The config_settings method provides access to the configuration
|
130
156
|
# settings.
|
131
157
|
#
|
@@ -405,54 +431,55 @@ class Utils::ConfigFile
|
|
405
431
|
@discover ||= Discover.new
|
406
432
|
end
|
407
433
|
|
408
|
-
# A configuration class for
|
434
|
+
# A configuration class for code indexing operations.
|
409
435
|
#
|
410
|
-
# This class manages the configuration settings for
|
411
|
-
#
|
412
|
-
# and
|
413
|
-
#
|
414
|
-
#
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
436
|
+
# This class manages the configuration settings for generating code indexes
|
437
|
+
# like ctags and cscope. It provides functionality to define which paths
|
438
|
+
# should be indexed and what file formats should be generated for each
|
439
|
+
# indexing tool.
|
440
|
+
#
|
441
|
+
# @example
|
442
|
+
# indexer = Utils::ConfigFile.new.code_indexer do |config|
|
443
|
+
# config.paths = %w[ lib spec ]
|
444
|
+
# config.formats = { 'ctags' => 'tags', 'cscope' => 'cscope.out' }
|
445
|
+
# end
|
446
|
+
#
|
447
|
+
# The paths config configures the directories to be included in the index
|
448
|
+
# generation process.
|
449
|
+
#
|
450
|
+
# The formats config configures the output file formats for different indexing
|
451
|
+
# tools and the output filenames.
|
452
|
+
class CodeIndexer < BlockConfig
|
453
|
+
config :verbose, false
|
426
454
|
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
#
|
436
|
-
# @param pattern [ Regexp ] the regular expression pattern used to identify files to skip
|
437
|
-
config :skip_files, /(\A\.|\.sw[pon]\z|\.log\z|~\z)/
|
455
|
+
lazy_config :paths do
|
456
|
+
%w[ bin lib spec tests ]
|
457
|
+
end
|
458
|
+
|
459
|
+
config :formats, {
|
460
|
+
'ctags' => 'tags',
|
461
|
+
'cscope' => 'cscope.out',
|
462
|
+
}
|
438
463
|
end
|
439
464
|
|
440
|
-
# The
|
465
|
+
# The code_indexer method manages and returns a CodeIndexer configuration
|
466
|
+
# instance.
|
441
467
|
#
|
442
|
-
# This method
|
443
|
-
#
|
444
|
-
#
|
445
|
-
#
|
468
|
+
# This method provides access to a CodeIndexer object that handles configuration
|
469
|
+
# for generating code indexes such as ctags and cscope files. It ensures that only
|
470
|
+
# one CodeIndexer instance is created per object by storing it in an instance variable.
|
471
|
+
# When a block is provided, it initializes the CodeIndexer with custom settings;
|
472
|
+
# otherwise, it returns a default CodeIndexer instance.
|
446
473
|
#
|
447
|
-
# @param block [ Proc ] optional block to
|
474
|
+
# @param block [ Proc ] optional block to configure the CodeIndexer object
|
448
475
|
#
|
449
|
-
# @return [ Utils::
|
450
|
-
# or default settings
|
451
|
-
def
|
476
|
+
# @return [ Utils::ConfigFile::CodeIndexer ] a CodeIndexer configuration instance
|
477
|
+
# configured either by the block or with default settings
|
478
|
+
def code_indexer(&block)
|
452
479
|
if block
|
453
|
-
@
|
480
|
+
@code_indexer = CodeIndexer.new(&block)
|
454
481
|
end
|
455
|
-
@
|
482
|
+
@code_indexer ||= CodeIndexer.new
|
456
483
|
end
|
457
484
|
|
458
485
|
# A configuration class for whitespace handling operations.
|
data/lib/utils/version.rb
CHANGED
data/utils.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: utils 0.
|
2
|
+
# stub: utils 0.76.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "utils".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.76.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]
|
@@ -11,9 +11,9 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.date = "1980-01-02"
|
12
12
|
s.description = "This ruby gem provides some useful command line utilities".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
|
-
s.executables = ["ascii7".freeze, "blameline".freeze, "changes".freeze, "classify".freeze, "code_comment".freeze, "
|
14
|
+
s.executables = ["ascii7".freeze, "blameline".freeze, "changes".freeze, "classify".freeze, "code_comment".freeze, "code_indexer".freeze, "commit_message".freeze, "discover".freeze, "edit".freeze, "edit_wait".freeze, "enum".freeze, "git-empty".freeze, "git-versions".freeze, "json_check".freeze, "long_lines".freeze, "myex".freeze, "on_change".freeze, "path".freeze, "print_method".freeze, "probe".freeze, "rainbow".freeze, "rd2md".freeze, "search".freeze, "sedit".freeze, "serve".freeze, "ssh-tunnel".freeze, "strip_spaces".freeze, "sync_dir".freeze, "untest".freeze, "utils-utilsrc".freeze, "vcf2alias".freeze, "yaml_check".freeze]
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/utils.rb".freeze, "lib/utils/config_dir.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze]
|
16
|
-
s.files = [".github/dependabot.yml".freeze, ".github/workflows/codeql-analysis.yml".freeze, ".utilsrc".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ascii7".freeze, "bin/blameline".freeze, "bin/changes".freeze, "bin/classify".freeze, "bin/code_comment".freeze, "bin/
|
16
|
+
s.files = [".github/dependabot.yml".freeze, ".github/workflows/codeql-analysis.yml".freeze, ".utilsrc".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ascii7".freeze, "bin/blameline".freeze, "bin/changes".freeze, "bin/classify".freeze, "bin/code_comment".freeze, "bin/code_indexer".freeze, "bin/commit_message".freeze, "bin/discover".freeze, "bin/edit".freeze, "bin/edit_wait".freeze, "bin/enum".freeze, "bin/git-empty".freeze, "bin/git-versions".freeze, "bin/json_check".freeze, "bin/long_lines".freeze, "bin/myex".freeze, "bin/on_change".freeze, "bin/path".freeze, "bin/print_method".freeze, "bin/probe".freeze, "bin/rainbow".freeze, "bin/rd2md".freeze, "bin/search".freeze, "bin/sedit".freeze, "bin/serve".freeze, "bin/ssh-tunnel".freeze, "bin/strip_spaces".freeze, "bin/sync_dir".freeze, "bin/untest".freeze, "bin/utils-utilsrc".freeze, "bin/vcf2alias".freeze, "bin/yaml_check".freeze, "lib/utils.rb".freeze, "lib/utils/config_dir.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze, "tests/test_helper.rb".freeze, "tests/utils_test.rb".freeze, "utils.gemspec".freeze]
|
17
17
|
s.homepage = "http://github.com/flori/utils".freeze
|
18
18
|
s.licenses = ["GPL-2.0".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "Utils - Some useful command line utilities".freeze, "--main".freeze, "README.md".freeze]
|
@@ -23,11 +23,11 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.specification_version = 4
|
25
25
|
|
26
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.
|
26
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.2".freeze])
|
27
27
|
s.add_development_dependency(%q<test-unit>.freeze, [">= 0".freeze])
|
28
28
|
s.add_runtime_dependency(%q<unix_socks>.freeze, [">= 0".freeze])
|
29
29
|
s.add_runtime_dependency(%q<webrick>.freeze, [">= 0".freeze])
|
30
|
-
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.
|
30
|
+
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.43".freeze])
|
31
31
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
|
32
32
|
s.add_runtime_dependency(%q<pstree>.freeze, ["~> 0.3".freeze])
|
33
33
|
s.add_runtime_dependency(%q<infobar>.freeze, ["~> 0.8".freeze])
|
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.6".freeze])
|
38
38
|
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.1".freeze])
|
39
39
|
s.add_runtime_dependency(%q<figlet>.freeze, ["~> 1.0".freeze])
|
40
|
+
s.add_runtime_dependency(%q<starscope>.freeze, [">= 0".freeze])
|
40
41
|
s.add_runtime_dependency(%q<context_spook>.freeze, ["~> 0.2".freeze])
|
41
42
|
s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
42
43
|
s.add_runtime_dependency(%q<debug>.freeze, [">= 0".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.
|
4
|
+
version: 0.76.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.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: '2.
|
25
|
+
version: '2.2'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: test-unit
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,14 +71,14 @@ dependencies:
|
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '1.
|
74
|
+
version: '1.43'
|
75
75
|
type: :runtime
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '1.
|
81
|
+
version: '1.43'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: term-ansicolor
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,6 +205,20 @@ dependencies:
|
|
205
205
|
- - "~>"
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '1.0'
|
208
|
+
- !ruby/object:Gem::Dependency
|
209
|
+
name: starscope
|
210
|
+
requirement: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
type: :runtime
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
208
222
|
- !ruby/object:Gem::Dependency
|
209
223
|
name: context_spook
|
210
224
|
requirement: !ruby/object:Gem::Requirement
|
@@ -255,9 +269,8 @@ executables:
|
|
255
269
|
- changes
|
256
270
|
- classify
|
257
271
|
- code_comment
|
272
|
+
- code_indexer
|
258
273
|
- commit_message
|
259
|
-
- create_cstags
|
260
|
-
- create_tags
|
261
274
|
- discover
|
262
275
|
- edit
|
263
276
|
- edit_wait
|
@@ -314,9 +327,8 @@ files:
|
|
314
327
|
- bin/changes
|
315
328
|
- bin/classify
|
316
329
|
- bin/code_comment
|
330
|
+
- bin/code_indexer
|
317
331
|
- bin/commit_message
|
318
|
-
- bin/create_cstags
|
319
|
-
- bin/create_tags
|
320
332
|
- bin/discover
|
321
333
|
- bin/edit
|
322
334
|
- bin/edit_wait
|
data/bin/create_cstags
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Create cscope database for project files
|
4
|
-
#
|
5
|
-
# Usage:
|
6
|
-
# create_cstags # Generate cscope.out database in current directory
|
7
|
-
#
|
8
|
-
# This script generates a cscope database (cscope.out) by collecting all
|
9
|
-
# project files and building an index for efficient cross-reference searching.
|
10
|
-
# It uses bundle paths and project roots to determine which files to include.
|
11
|
-
#
|
12
|
-
# Requires:
|
13
|
-
# - cscope command-line tool
|
14
|
-
#
|
15
|
-
# The script will:
|
16
|
-
# 1. Collect all files from project roots (including bundle paths)
|
17
|
-
# 2. Generate cscope.out database with cross-references
|
18
|
-
# 3. Show progress using infobar visualization
|
19
|
-
# 4. Report the size of the created database
|
20
|
-
|
21
|
-
require 'utils'
|
22
|
-
require 'infobar'
|
23
|
-
|
24
|
-
config = Utils::ConfigFile.new
|
25
|
-
config.configure_from_paths
|
26
|
-
|
27
|
-
roots = %w[ . ] + `bundle list --paths`.lines.map(&:chomp)
|
28
|
-
|
29
|
-
IO.popen('cscope 2>/dev/null -R -b -i - -f cscope.out', 'w') do |scope|
|
30
|
-
finder = Utils::Finder.new(
|
31
|
-
pattern: '',
|
32
|
-
roots: roots,
|
33
|
-
config: config,
|
34
|
-
)
|
35
|
-
finder.search.paths.with_infobar(label: 'Collecting files') do |path|
|
36
|
-
scope.puts path
|
37
|
-
+infobar
|
38
|
-
end
|
39
|
-
|
40
|
-
infobar.newline
|
41
|
-
Infobar.busy(label: 'Creating cstags', frames: :braille7) do
|
42
|
-
scope.close
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
if megabytes = File.size('cscope.out').to_f / 1024 ** 2 rescue nil
|
47
|
-
infobar.puts 'Created %.3fM of cstags.' % megabytes
|
48
|
-
end
|
data/bin/create_tags
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Creates ctags index for Ruby project including bundled gems
|
4
|
-
#
|
5
|
-
# This script generates a tags file that enables code navigation in editors
|
6
|
-
# like Vim. It automatically includes:
|
7
|
-
# - Current directory (.)
|
8
|
-
# - All gem paths from bundle list
|
9
|
-
# - Excludes pkg directory to avoid vendor code
|
10
|
-
#
|
11
|
-
# Usage: Run directly from project root
|
12
|
-
|
13
|
-
require 'infobar'
|
14
|
-
|
15
|
-
paths = %w[ . ] + `bundle list --paths`.lines.map(&:chomp)
|
16
|
-
cmd = %w[ ctags --recurse=yes --exclude=pkg --languages=Ruby,C ] + paths
|
17
|
-
Infobar.busy(label: 'Creating tags', frames: :braille7) { system(*cmd) }
|
18
|
-
if megabytes = File.size('tags').to_f / 1024 ** 2 rescue nil
|
19
|
-
infobar.puts 'Created %.3fM of tags.' % megabytes
|
20
|
-
end
|