Class: RailsMcpInsight::Configuration
- Inherits:
-
Object
- Object
- RailsMcpInsight::Configuration
- Defined in:
- lib/rails_mcp_insight/configuration.rb
Overview
Holds all configuration for the MCP server and analyzers. Immutable after initialization — thread-safe by design.
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
-
#db_path ⇒ Object
readonly
Returns the value of attribute db_path.
-
#lib_path ⇒ Object
readonly
Returns the value of attribute lib_path.
-
#project_path ⇒ Object
readonly
Returns the value of attribute project_path.
-
#spec_path ⇒ Object
readonly
Returns the value of attribute spec_path.
-
#test_path ⇒ Object
readonly
Returns the value of attribute test_path.
Instance Method Summary collapse
- #controllers_path ⇒ Object
- #gemfile_lock_path ⇒ Object
- #gemfile_path ⇒ Object
-
#initialize(project_path: Dir.pwd) ⇒ Configuration
constructor
A new instance of Configuration.
- #jobs_path ⇒ Object
- #mailers_path ⇒ Object
- #migrations_path ⇒ Object
- #models_path ⇒ Object
- #rails_app? ⇒ Boolean
- #routes_file ⇒ Object
- #schema_file ⇒ Object
- #services_path ⇒ Object
- #structure_file ⇒ Object
- #views_path ⇒ Object
Constructor Details
#initialize(project_path: Dir.pwd) ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 |
# File 'lib/rails_mcp_insight/configuration.rb', line 10 def initialize(project_path: Dir.pwd) @project_path = File.(project_path) @app_path = File.join(@project_path, "app") @config_path = File.join(@project_path, "config") @db_path = File.join(@project_path, "db") @spec_path = File.join(@project_path, "spec") @test_path = File.join(@project_path, "test") @lib_path = File.join(@project_path, "lib") end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def app_path @app_path end |
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def config_path @config_path end |
#db_path ⇒ Object (readonly)
Returns the value of attribute db_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def db_path @db_path end |
#lib_path ⇒ Object (readonly)
Returns the value of attribute lib_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def lib_path @lib_path end |
#project_path ⇒ Object (readonly)
Returns the value of attribute project_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def project_path @project_path end |
#spec_path ⇒ Object (readonly)
Returns the value of attribute spec_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def spec_path @spec_path end |
#test_path ⇒ Object (readonly)
Returns the value of attribute test_path.
7 8 9 |
# File 'lib/rails_mcp_insight/configuration.rb', line 7 def test_path @test_path end |
Instance Method Details
#controllers_path ⇒ Object
24 25 26 |
# File 'lib/rails_mcp_insight/configuration.rb', line 24 def controllers_path File.join(@app_path, "controllers") end |
#gemfile_lock_path ⇒ Object
60 61 62 |
# File 'lib/rails_mcp_insight/configuration.rb', line 60 def gemfile_lock_path File.join(@project_path, "Gemfile.lock") end |
#gemfile_path ⇒ Object
56 57 58 |
# File 'lib/rails_mcp_insight/configuration.rb', line 56 def gemfile_path File.join(@project_path, "Gemfile") end |
#jobs_path ⇒ Object
28 29 30 |
# File 'lib/rails_mcp_insight/configuration.rb', line 28 def jobs_path File.join(@app_path, "jobs") end |
#mailers_path ⇒ Object
32 33 34 |
# File 'lib/rails_mcp_insight/configuration.rb', line 32 def mailers_path File.join(@app_path, "mailers") end |
#migrations_path ⇒ Object
64 65 66 |
# File 'lib/rails_mcp_insight/configuration.rb', line 64 def migrations_path File.join(@db_path, "migrate") end |
#models_path ⇒ Object
20 21 22 |
# File 'lib/rails_mcp_insight/configuration.rb', line 20 def models_path File.join(@app_path, "models") end |
#rails_app? ⇒ Boolean
68 69 70 71 72 |
# File 'lib/rails_mcp_insight/configuration.rb', line 68 def rails_app? File.exist?(routes_file) && File.exist?(gemfile_path) && Dir.exist?(@app_path) end |
#routes_file ⇒ Object
44 45 46 |
# File 'lib/rails_mcp_insight/configuration.rb', line 44 def routes_file File.join(@config_path, "routes.rb") end |
#schema_file ⇒ Object
48 49 50 |
# File 'lib/rails_mcp_insight/configuration.rb', line 48 def schema_file File.join(@db_path, "schema.rb") end |
#services_path ⇒ Object
40 41 42 |
# File 'lib/rails_mcp_insight/configuration.rb', line 40 def services_path File.join(@app_path, "services") end |
#structure_file ⇒ Object
52 53 54 |
# File 'lib/rails_mcp_insight/configuration.rb', line 52 def structure_file File.join(@db_path, "structure.sql") end |
#views_path ⇒ Object
36 37 38 |
# File 'lib/rails_mcp_insight/configuration.rb', line 36 def views_path File.join(@app_path, "views") end |