rails-ai-context 0.5.1 → 0.5.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: ccfa985d6c8909c3c3aac2bd7a9a2e06937a9b6b0ccf0b68b529e664d0a47766
4
- data.tar.gz: e76ba121b0be84a212f1e8d63eea60d9cbde88c3cc2df795ac182980c32e4268
3
+ metadata.gz: 8378145ec19882ed7d2eb8c088da05bca9df2cdea61f566d4690310f50d3825a
4
+ data.tar.gz: 53e3377b30f932baa6ed0d42e3b91dc2b20a5e5b05f459a6315716dbe48a7161
5
5
  SHA512:
6
- metadata.gz: a2db336162ecba283d739840fa4709ceb68859361c055821c657bd4f0e1f49e19a72d7dc0665e1e7eeb3f5a64ecfdfaf030f71c4157210da45da48b3ca363bce
7
- data.tar.gz: 9c95fb8b53101af641ae6340dd0cd04219984f70ec87ed676b8473b301028343796304c79651f844416b2d909c0e203bcb1bf90a3217524c1400c2465ff3a2df
6
+ metadata.gz: 629a78fe135ff955a71ceb870baf6a49c3d178e7358254ac9b88143cad6212e7b3190745835754b3b726148f0469080fd1a71d12c6c1eb1ab9b31a7bd095e3e8
7
+ data.tar.gz: aeb99f7ca9638fd00066b1f4a21758ad4cbcd1f447dae77c26245b55eb9f9954165a06f1114cf0cc2091a60925e9dc42ad747d9155c2e08bb070ca5b4247f47d
data/CHANGELOG.md CHANGED
@@ -5,11 +5,13 @@ 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
- ## [0.5.1] - 2026-03-18
8
+ ## [0.5.2] - 2026-03-18
9
9
 
10
10
  ### Fixed
11
11
 
12
- - **Documentation updates** — Updated CONTRIBUTING.md, CHANGELOG.md, and CLAUDE.md to reflect Zeitwerk autoloading, introspector presets, and `.mcp.json` auto-discovery changes
12
+ - **MCP tool nil crash** — All 9 MCP tools now handle missing introspector data gracefully instead of crashing with `NoMethodError` when the introspector is not in the active preset (e.g. `rails_get_config` with `:standard` preset)
13
+ - **Zeitwerk dependency** — Changed from open-ended `>= 2.6` to pessimistic `~> 2.6` per RubyGems best practices
14
+ - **Documentation** — Updated CONTRIBUTING.md, CHANGELOG.md, and CLAUDE.md to reflect Zeitwerk autoloading, introspector presets, and `.mcp.json` auto-discovery changes
13
15
 
14
16
  ## [0.5.0] - 2026-03-18
15
17
 
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![CI](https://github.com/crisnahine/rails-ai-context/actions/workflows/ci.yml/badge.svg)](https://github.com/crisnahine/rails-ai-context/actions)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
7
 
8
- ![Demo](demo.gif)
8
+ ![Demo](demo.gif?v=0.5.2)
9
9
 
10
10
  `rails-ai-context` automatically introspects your Rails application and exposes your models, routes, schema, controllers, views, jobs, gems, auth, API, tests, config, and conventions to AI assistants through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io).
11
11
 
data/demo.gif CHANGED
Binary file
data/demo_script.sh CHANGED
@@ -8,7 +8,7 @@ echo 'Fetching gem metadata from https://rubygems.org...'
8
8
  sleep 0.3
9
9
  echo 'Resolving dependencies...'
10
10
  sleep 0.3
11
- echo 'Installing rails-ai-context 0.5.1'
11
+ echo 'Installing rails-ai-context 0.5.2'
12
12
  echo ''
13
13
  sleep 1
14
14
 
@@ -12,6 +12,7 @@ module RailsAiContext
12
12
 
13
13
  def self.call(server_context: nil)
14
14
  data = cached_context[:config]
15
+ return text_response("Config introspection not available. Add :config to introspectors or use `config.preset = :full`.") unless data
15
16
  return text_response("Config introspection failed: #{data[:error]}") if data[:error]
16
17
 
17
18
  lines = [ "# Application Configuration", "" ]
@@ -19,6 +19,7 @@ module RailsAiContext
19
19
 
20
20
  def self.call(controller: nil, server_context: nil)
21
21
  data = cached_context[:controllers]
22
+ return text_response("Controller introspection not available. Add :controllers to introspectors.") unless data
22
23
  return text_response("Controller introspection failed: #{data[:error]}") if data[:error]
23
24
 
24
25
  controllers = data[:controllers] || {}
@@ -12,7 +12,8 @@ module RailsAiContext
12
12
 
13
13
  def self.call(server_context: nil)
14
14
  conventions = cached_context[:conventions]
15
- return text_response("Convention detection failed: #{conventions[:error]}") if conventions.is_a?(Hash) && conventions[:error]
15
+ return text_response("Convention detection not available. Add :conventions to introspectors.") unless conventions
16
+ return text_response("Convention detection failed: #{conventions[:error]}") if conventions[:error]
16
17
 
17
18
  lines = [ "# App Conventions & Architecture", "" ]
18
19
 
@@ -20,6 +20,7 @@ module RailsAiContext
20
20
 
21
21
  def self.call(category: "all", server_context: nil)
22
22
  gems = cached_context[:gems]
23
+ return text_response("Gem introspection not available. Add :gems to introspectors.") unless gems
23
24
  return text_response("Gem introspection failed: #{gems[:error]}") if gems[:error]
24
25
 
25
26
  notable = gems[:notable_gems] || []
@@ -19,7 +19,8 @@ module RailsAiContext
19
19
 
20
20
  def self.call(model: nil, server_context: nil)
21
21
  models = cached_context[:models]
22
- return text_response("Model introspection failed: #{models[:error]}") if models.is_a?(Hash) && models[:error]
22
+ return text_response("Model introspection not available. Add :models to introspectors.") unless models
23
+ return text_response("Model introspection failed: #{models[:error]}") if models[:error]
23
24
 
24
25
  unless model
25
26
  model_list = models.keys.sort.map { |m| "- #{m}" }.join("\n")
@@ -19,6 +19,7 @@ module RailsAiContext
19
19
 
20
20
  def self.call(controller: nil, server_context: nil)
21
21
  routes = cached_context[:routes]
22
+ return text_response("Route introspection not available. Add :routes to introspectors.") unless routes
22
23
  return text_response("Route introspection failed: #{routes[:error]}") if routes[:error]
23
24
 
24
25
  by_controller = routes[:by_controller] || {}
@@ -29,6 +29,7 @@ module RailsAiContext
29
29
 
30
30
  def self.call(table: nil, format: "markdown", server_context: nil)
31
31
  schema = cached_context[:schema]
32
+ return text_response("Schema introspection not available. Add :schema to introspectors.") unless schema
32
33
  return text_response("Schema introspection not available: #{schema[:error]}") if schema[:error]
33
34
 
34
35
  tables = schema[:tables] || {}
@@ -12,6 +12,7 @@ module RailsAiContext
12
12
 
13
13
  def self.call(server_context: nil)
14
14
  data = cached_context[:tests]
15
+ return text_response("Test introspection not available. Add :tests to introspectors.") unless data
15
16
  return text_response("Test introspection failed: #{data[:error]}") if data[:error]
16
17
 
17
18
  lines = [ "# Test Infrastructure", "" ]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAiContext
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.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: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - crisnahine
@@ -67,14 +67,14 @@ dependencies:
67
67
  name: zeitwerk
68
68
  requirement: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - ">="
70
+ - - "~>"
71
71
  - !ruby/object:Gem::Version
72
72
  version: '2.6'
73
73
  type: :runtime
74
74
  prerelease: false
75
75
  version_requirements: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ">="
77
+ - - "~>"
78
78
  - !ruby/object:Gem::Version
79
79
  version: '2.6'
80
80
  - !ruby/object:Gem::Dependency