-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
59 lines (48 loc) · 1.59 KB
/
Rakefile
File metadata and controls
59 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task default: :spec
# Load gem tasks for non-Rails usage
namespace :ruby_ai_gem_context do
require_relative "lib/ruby_ai_gem_context"
desc "Aggregate mcp_context/ from all gems into .ai_context/"
task :aggregate do
puts "Scanning gems for mcp_context/ folders..."
result = RubyAiGemContext::Aggregator.aggregate
gems = result["gems"]
if gems.empty?
puts "No gems with mcp_context/ folders found."
else
puts "\nAggregated context from #{gems.size} gem(s):"
gems.each do |name, info|
puts " - #{name} (#{info['version']}): #{info['files'].size} file(s)"
end
puts "\nContext written to: #{RubyAiGemContext.configuration.output_path}/"
end
end
desc "Remove the .ai_context/ folder"
task :clear do
output_path = RubyAiGemContext.configuration.output_path
if File.exist?(output_path)
RubyAiGemContext::Aggregator.clear
puts "Removed #{output_path}/"
else
puts "#{output_path}/ does not exist."
end
end
desc "List all gems that have mcp_context/ folders"
task :list do
puts "Scanning gems for mcp_context/ folders..."
gems = RubyAiGemContext::Scanner.list_gems_with_context
if gems.empty?
puts "No gems with mcp_context/ folders found."
else
puts "\nFound #{gems.size} gem(s) with mcp_context/:"
gems.each do |gem_info|
puts " - #{gem_info[:name]} (#{gem_info[:version]})"
puts " Path: #{gem_info[:path]}"
end
end
end
end