rails-active-mcp 0.1.1 → 0.1.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: c88ad5ec7c769714d518060dff566fd4578f8831b02128be92f3f741d481886f
4
- data.tar.gz: a57f58673130bfd1d3a66847cdcdf16c1b1629f1bb82a28ed75fb8ff44a01acc
3
+ metadata.gz: bec983e79b11a278a9f7c39de53d6eff389f4ebbd951e9a613ce313ea3a48ba2
4
+ data.tar.gz: ed94322b6c2bb06cff349166dbdf4d95babeea80ac6ae2c355683c19c0dc682e
5
5
  SHA512:
6
- metadata.gz: ddb8d8c4627ea15b8290923c1dc00edb8e98e34ef6c26bf3b0ecce25c5cbb72cad22a7df5aa2d2bd4f7b878a8ac584b7df73f3e08128af10624aa0c0d3592997
7
- data.tar.gz: 50ca2b25b14d8e927f916ce21cfca0c19d0bbd287aafd56416ef379174fffe5ee7959e29a6d6da1f5e95cec9b83e4b4fa352d68d3eb5778f75065e83f674febe
6
+ metadata.gz: 2281c14e99c4f2ad588fe0b222e060cb0b04e9bf0b3b874c284d6f6d6db8757a91d46a1aba7a77f365fe45c518d3a9e9bc58e2e2fbd6738c167334adfd252436
7
+ data.tar.gz: '0178374d4a7e8c365c582f8cc11ffce5c28d23b3ea8d0d35078cea47eaff5a3d316749ec28b7e724815e293c439b05c989be20187abed0f076d443463da4afbb'
@@ -1,37 +1,40 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class RailsActiveMcp::InstallGenerator < Rails::Generators::Base
4
- source_root File.expand_path('templates', __dir__)
5
-
6
- desc 'Install Rails Active MCP'
7
-
8
- def create_initializer
9
- template 'initializer.rb', 'config/initializers/rails_active_mcp.rb'
10
- end
11
-
12
- def create_mcp_route
13
- route "mount RailsActiveMcp::McpServer.new, at: '/mcp' # Rails Active MCP"
14
- end
15
-
16
- def create_mcp_config
17
- template 'mcp.ru', 'mcp.ru'
18
- end
19
-
20
- def show_readme
21
- readme 'README.md' if behavior == :invoke
22
- end
23
-
24
- private
25
-
26
- def readme(path)
27
- readme_path = File.join(self.class.source_root, path)
28
- if File.exist?(readme_path)
29
- say IO.read(readme_path), :green
30
- else
31
- say "README file not found at #{readme_path}", :yellow
3
+ module RailsActiveMcp
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('templates', __dir__)
7
+
8
+ desc 'Install Rails Active MCP'
9
+
10
+ def create_initializer
11
+ template 'initializer.rb', 'config/initializers/rails_active_mcp.rb'
12
+ end
13
+
14
+ def create_mcp_route
15
+ route "mount RailsActiveMcp::McpServer.new, at: '/mcp' # Rails Active MCP"
16
+ end
17
+
18
+ def create_mcp_config
19
+ template 'mcp.ru', 'mcp.ru'
20
+ end
21
+
22
+ def show_readme
23
+ readme 'README.md' if behavior == :invoke
24
+ end
25
+
26
+ private
27
+
28
+ def readme(path)
29
+ readme_path = File.join(self.class.source_root, path)
30
+ if File.exist?(readme_path)
31
+ say IO.read(readme_path), :green
32
+ else
33
+ say "README file not found at #{readme_path}", :yellow
34
+ end
35
+ rescue StandardError => e
36
+ say "Error reading README: #{e.message}", :red
37
+ end
32
38
  end
33
- rescue => e
34
- say "Error reading README: #{e.message}", :red
35
39
  end
36
-
37
40
  end
@@ -6,6 +6,13 @@ module RailsActiveMcp
6
6
 
7
7
  config.rails_active_mcp = ActiveSupport::OrderedOptions.new
8
8
 
9
+ # Add generators configuration
10
+ config.generators do |g|
11
+ g.test_framework :rspec, fixture: false
12
+ g.assets false
13
+ g.helper false
14
+ end
15
+
9
16
  initializer 'rails_active_mcp.configure' do |app|
10
17
  # Load configuration from Rails config if present
11
18
  if app.config.respond_to?(:rails_active_mcp)
@@ -28,5 +35,31 @@ module RailsActiveMcp
28
35
 
29
36
  # Ensure our tools are eager loaded in production
30
37
  config.eager_load_paths << root.join('lib', 'rails_active_mcp', 'tools')
38
+
39
+ # Add rake tasks
40
+ rake_tasks do
41
+ load 'rails_active_mcp/tasks.rake'
42
+ end
43
+
44
+ # Console hook for easier access
45
+ console do
46
+ # Add convenience methods to console
47
+ Rails::ConsoleMethods.include(RailsActiveMcp::ConsoleMethods) if defined?(Rails::ConsoleMethods)
48
+ end
49
+ end
50
+
51
+ # Console convenience methods
52
+ module ConsoleMethods
53
+ def mcp_execute(code, **options)
54
+ RailsActiveMcp.execute(code, **options)
55
+ end
56
+
57
+ def mcp_safe?(code)
58
+ RailsActiveMcp.safe?(code)
59
+ end
60
+
61
+ def mcp_config
62
+ RailsActiveMcp.config
63
+ end
31
64
  end
32
65
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsActiveMcp
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -6,8 +6,9 @@ require_relative 'rails_active_mcp/configuration'
6
6
  require_relative 'rails_active_mcp/safety_checker'
7
7
  require_relative 'rails_active_mcp/console_executor'
8
8
  require_relative 'rails_active_mcp/mcp_server'
9
- require_relative 'rails_active_mcp/engine' if defined?(Rails)
10
9
 
10
+ # Load Engine for Rails integration
11
+ require_relative 'rails_active_mcp/engine' if defined?(Rails)
11
12
 
12
13
  module RailsActiveMcp
13
14
  class Error < StandardError; end
@@ -54,6 +55,3 @@ module RailsActiveMcp
54
55
  end
55
56
  end
56
57
  end
57
-
58
- # Auto-configure for Rails
59
- require_relative 'rails_active_mcp/railtie' if defined?(Rails)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-active-mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandyn Britton