rails-ai-context 4.2.1 → 4.2.2

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: c4979f73cd9d2deaa6568c81bcc22a42034cc26ead1012e18ccc9afd202cd94b
4
- data.tar.gz: 90399f07e1d97b4d3ce24a0e203db4febb297810451cea6e3c4a81c2e222b2fc
3
+ metadata.gz: 9930b0d98fb5e6eb1203d30ed2aa29e1582d8d7dce45b8b6046dbf319b6848c6
4
+ data.tar.gz: c8c16b4b5d5d7f2f677079b6b32162f4d1c808cf4766e5ff864386c86deaf5fc
5
5
  SHA512:
6
- metadata.gz: 47b89a0f367cc401a28175031f46db972f8a2756aa4757cf73864216e98a9bb6fa09b3f7e30686c24e11ca32bae0388b4d2d190be11fa953a6271c7ae67dab20
7
- data.tar.gz: 464042799cda86f8ab622c1ac6de5201874749d24e548ba55b2f4d2781ea684c35baf59edeeb8f7c1a8788186b1b8e86784a86987b612043c01d1ff680030ca8
6
+ metadata.gz: 8fd433d22ebcc80e37e3b42e2b81a194cea749bc3a58a5c9cc6a062d263e8c38b4d8e2566197c931d26fd192120f7a327d4fe997141d928ecede7b671bf7bdae
7
+ data.tar.gz: ee8e50f02af410230d37e703eaf048f540f7c8ac7ea745686349c4a16ba5c9e74f0e429c77948f87930089c97cc79ccf5e3510f7f939d0bb0a91bf1f781fb371
data/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.2.2] — 2026-04-01
9
+
10
+ ### Fixed
11
+ - **Vite config detection** — framework plugin detection now checks `.mts`, `.mjs`, `.cts`, `.cjs` extensions in addition to `.ts` and `.js`
12
+ - **Component catalog ERB** — no-props no-slots components now generate inline `<%= render Foo.new %>` instead of misleading `do...end` block
13
+ - **Custom tools validation** — invalid entries in `config.custom_tools` are now filtered with a clear warning instead of crashing the MCP server with a cryptic `NoMethodError`
14
+
15
+ ### Changed
16
+ - Test count: 998 → 1003
17
+
8
18
  ## [4.2.1] — 2026-03-31
9
19
 
10
20
  ### Fixed
data/CLAUDE.md CHANGED
@@ -60,7 +60,7 @@ structure to AI assistants via the Model Context Protocol (MCP).
60
60
  ## Testing
61
61
 
62
62
  ```bash
63
- bundle exec rspec # Run specs (998 examples)
63
+ bundle exec rspec # Run specs (1003 examples)
64
64
  bundle exec rubocop # Lint
65
65
  ```
66
66
 
data/README.md CHANGED
@@ -8,12 +8,12 @@
8
8
  [![MCP Registry](https://img.shields.io/badge/MCP_Registry-listed-green)](https://registry.modelcontextprotocol.io)
9
9
  [![Ruby](https://img.shields.io/badge/Ruby-3.2%20%7C%203.3%20%7C%203.4-red)](https://github.com/crisnahine/rails-ai-context)
10
10
  [![Rails](https://img.shields.io/badge/Rails-7.1%20%7C%207.2%20%7C%208.0-red)](https://github.com/crisnahine/rails-ai-context)
11
- [![Tests](https://img.shields.io/badge/Tests-998%20passing-brightgreen)](https://github.com/crisnahine/rails-ai-context/actions)
11
+ [![Tests](https://img.shields.io/badge/Tests-1003%20passing-brightgreen)](https://github.com/crisnahine/rails-ai-context/actions)
12
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
13
13
 
14
14
  **Works with:** Claude Code &bull; Cursor &bull; GitHub Copilot &bull; OpenCode &bull; Any terminal
15
15
 
16
- > Built by a Rails developer with 10+ years of production experience. AI assisted — the same way it assists me shipping features at work. I designed the architecture, made every decision, reviewed every line, and wrote 998 tests. This gem exists because I understand Rails deeply enough to know exactly what AI agents get wrong and what context they need to get it right.
16
+ > Built by a Rails developer with 10+ years of production experience. AI assisted — the same way it assists me shipping features at work. I designed the architecture, made every decision, reviewed every line, and wrote 1003 tests. This gem exists because I understand Rails deeply enough to know exactly what AI agents get wrong and what context they need to get it right.
17
17
 
18
18
  ```bash
19
19
  gem "rails-ai-context", group: :development
@@ -262,7 +262,7 @@ module RailsAiContext
262
262
 
263
263
  def detect_vite_config_frameworks
264
264
  found = []
265
- %w[vite.config.ts vite.config.js].each do |filename|
265
+ %w[vite.config.ts vite.config.js vite.config.mts vite.config.mjs vite.config.cts vite.config.cjs].each do |filename|
266
266
  path = File.join(root, filename)
267
267
  next unless File.exist?(path)
268
268
 
@@ -53,10 +53,19 @@ module RailsAiContext
53
53
  def build
54
54
  config = RailsAiContext.configuration
55
55
 
56
+ validated_custom_tools = config.custom_tools.select do |tool|
57
+ if tool.is_a?(Class) && tool < MCP::Tool
58
+ true
59
+ else
60
+ $stderr.puts "[rails-ai-context] WARNING: Skipping invalid custom_tool #{tool.inspect} (must be an MCP::Tool subclass)"
61
+ false
62
+ end
63
+ end
64
+
56
65
  server = MCP::Server.new(
57
66
  name: config.server_name,
58
67
  version: config.server_version,
59
- tools: active_tools(config) + config.custom_tools,
68
+ tools: active_tools(config) + validated_custom_tools,
60
69
  resource_templates: Resources.resource_templates
61
70
  )
62
71
 
@@ -155,7 +155,11 @@ module RailsAiContext
155
155
  init = parts.any? ? "(#{parts.join(', ')})" : ".new"
156
156
 
157
157
  if slots.empty?
158
- "<%= render #{name}.new#{init == ".new" ? "" : init} do %>\n Content here\n<% end %>"
158
+ if init == ".new"
159
+ "<%= render #{name}.new %>"
160
+ else
161
+ "<%= render #{name}.new#{init} do %>\n Content here\n<% end %>"
162
+ end
159
163
  else
160
164
  result = "<%= render #{name}.new#{init == ".new" ? "" : init} do |c| %>"
161
165
  slots.each do |slot|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAiContext
4
- VERSION = "4.2.1"
4
+ VERSION = "4.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-ai-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - crisnahine