Class: Mbeditor::Configuration
- Inherits:
-
Object
- Object
- Mbeditor::Configuration
- Defined in:
- lib/mbeditor/configuration.rb
Instance Attribute Summary collapse
-
#allowed_environments ⇒ Object
Returns the value of attribute allowed_environments.
-
#authenticate_with ⇒ Object
Returns the value of attribute authenticate_with.
-
#authentication_cache_ttl ⇒ Object
Returns the value of attribute authentication_cache_ttl.
-
#babel_standalone_path ⇒ Object
Returns the value of attribute babel_standalone_path.
-
#base_branch_candidates ⇒ Object
Returns the value of attribute base_branch_candidates.
-
#exception_capture ⇒ Object
Returns the value of attribute exception_capture.
-
#excluded_paths ⇒ Object
Returns the value of attribute excluded_paths.
-
#git_timeout ⇒ Object
Returns the value of attribute git_timeout.
-
#js_global_identifiers ⇒ Object
Returns the value of attribute js_global_identifiers.
-
#js_program ⇒ Object
Returns the value of attribute js_program.
-
#js_program_exclude ⇒ Object
Returns the value of attribute js_program_exclude.
-
#js_syntax_check ⇒ Object
Returns the value of attribute js_syntax_check.
-
#lint_timeout ⇒ Object
Returns the value of attribute lint_timeout.
-
#mount_path ⇒ Object
Returns the value of attribute mount_path.
-
#redmine_api_key ⇒ Object
Returns the value of attribute redmine_api_key.
-
#redmine_enabled ⇒ Object
Returns the value of attribute redmine_enabled.
-
#redmine_ticket_source ⇒ Object
Returns the value of attribute redmine_ticket_source.
-
#redmine_url ⇒ Object
Returns the value of attribute redmine_url.
-
#related_files_custom_paths ⇒ Object
Returns the value of attribute related_files_custom_paths.
-
#resilient_routing ⇒ Object
Returns the value of attribute resilient_routing.
-
#ripgrep_command ⇒ Object
Returns the value of attribute ripgrep_command.
-
#rubocop_command ⇒ Object
Returns the value of attribute rubocop_command.
-
#rubocop_server ⇒ Object
Returns the value of attribute rubocop_server.
-
#ruby_def_include_dirs ⇒ Object
Returns the value of attribute ruby_def_include_dirs.
-
#ruby_lsp ⇒ Object
Returns the value of attribute ruby_lsp.
-
#ruby_lsp_command ⇒ Object
Returns the value of attribute ruby_lsp_command.
-
#ruby_lsp_timeout ⇒ Object
Returns the value of attribute ruby_lsp_timeout.
-
#search_respect_gitignore ⇒ Object
Returns the value of attribute search_respect_gitignore.
-
#search_timeout ⇒ Object
Returns the value of attribute search_timeout.
-
#test_command ⇒ Object
Returns the value of attribute test_command.
-
#test_framework ⇒ Object
Returns the value of attribute test_framework.
-
#test_timeout ⇒ Object
Returns the value of attribute test_timeout.
-
#user_name_callback ⇒ Object
Returns the value of attribute user_name_callback.
-
#workspace_root ⇒ Object
Returns the value of attribute workspace_root.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/mbeditor/configuration.rb', line 18 def initialize @allowed_environments = [:development] @workspace_root = nil @excluded_paths = %w[.git tmp log node_modules .bundle coverage vendor/bundle public/assets storage] @rubocop_command = "rubocop" @rubocop_server = true # use rubocop's --server daemon (rubocop >= 1.31) for ~10x faster lint; false forces --no-server @redmine_enabled = false @redmine_url = nil @redmine_api_key = nil @redmine_ticket_source = :commit # :commit (scan commit messages) or :branch (leading digits of branch name) @test_framework = nil # :minitest or :rspec — auto-detected when nil @test_command = nil # e.g. "bundle exec ruby -Itest" or "bundle exec rspec" @test_timeout = 60 # seconds @lint_timeout = 15 # seconds for RuboCop/haml-lint subprocesses @base_branch_candidates = %w[origin/develop origin/main origin/master develop main master] @git_timeout = 10 # seconds; nil disables (no timeout on git subprocesses) @search_timeout = 15 # seconds; wall-clock bound on every search subprocess, nil disables # Skip .gitignore'd files in project search and definition lookups. # # Defaults to true, matching VS Code and ripgrep. The false path has to # ask git for --no-index, which walks every ignored tree the app has — # node_modules, public/packs, app/assets/builds, caches — and on the # git-grep tier (no ripgrep installed) that measured 29x slower on this # repo alone: 3714 files walked instead of 253. It also fills results # with matches inside minified bundles. # # Set to false to search ignored files too; expect it to be slow on a # machine without ripgrep. @search_respect_gitignore = true # Path to the ripgrep binary. nil auto-resolves: PATH first, then the # usual install prefixes. # # This matters more than it looks. ripgrep is 10-30x faster than the # git-grep fallback, and the probe used to run a bare "rg" — so it found # ripgrep only if the *server process* had it on PATH. A Rails server # started from launchd, systemd, foreman or an IDE typically inherits a # stripped PATH without /opt/homebrew/bin or /usr/local/bin, so ripgrep # could be installed and still invisible, silently dropping every search # to the slow tier. GET /workspace reports the tier actually in use. @ripgrep_command = nil @ruby_def_include_dirs = %w[app/models app/controllers app/helpers app/concerns] @related_files_custom_paths = [] @authentication_cache_ttl = 0 @user_name_callback = nil # proc resolved in controller context (instance_exec) → collaboration display name; nil falls through to the client-generated name @js_global_identifiers = [] # extra ambient JS globals for the editor (runtime-only names invisible to static scan, e.g. %w[Routes I18n]) # Load the workspace's own JS source into Monaco's TypeScript program, so # cross-file references get real inferred types instead of ambient `any`. @js_program = true # Excluded from that program on top of excluded_paths. Vendored libraries # are UMD-wrapped (the global is assigned inside a closure), so their # source yields no globals to TypeScript and only costs parse time — they # stay on ambient declarations instead. Add any other directory of # third-party or generated JS here, e.g. "app/assets/javascripts/react". @js_program_exclude = %w[vendor] @js_syntax_check = :auto # save-time babel parse check via host mini_racer + babel-standalone; false disables @babel_standalone_path = nil # explicit path to babel-standalone JS; nil auto-detects via the asset pipeline @ruby_lsp = :auto # use the host's ruby-lsp for Ruby definitions/hover/completion when available; false disables @ruby_lsp_command = nil # override the ruby-lsp launch command (String or Array); nil auto-resolves bin/ruby-lsp > gem > bundle exec @ruby_lsp_timeout = 3 # seconds per LSP request before falling back to the built-in services # Record exceptions raised by the host app's controllers so they show up # in the editor's Problems panel instead of only in the log. Development # only. Exception messages can contain interpolated request params — the # same exposure the log panel already has, since it tails the dev log. # Set to false to record nothing. @exception_capture = :auto @mount_path = nil # explicit URL prefix override; nil falls through to detection/"/mbeditor" @resilient_routing = true # serve /mbeditor from middleware so the editor survives a broken host routes.rb; false is the escape hatch end |
Instance Attribute Details
#allowed_environments ⇒ Object
Returns the value of attribute allowed_environments.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def allowed_environments @allowed_environments end |
#authenticate_with ⇒ Object
Returns the value of attribute authenticate_with.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def authenticate_with @authenticate_with end |
#authentication_cache_ttl ⇒ Object
Returns the value of attribute authentication_cache_ttl.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def authentication_cache_ttl @authentication_cache_ttl end |
#babel_standalone_path ⇒ Object
Returns the value of attribute babel_standalone_path.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def babel_standalone_path @babel_standalone_path end |
#base_branch_candidates ⇒ Object
Returns the value of attribute base_branch_candidates.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def base_branch_candidates @base_branch_candidates end |
#exception_capture ⇒ Object
Returns the value of attribute exception_capture.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def exception_capture @exception_capture end |
#excluded_paths ⇒ Object
Returns the value of attribute excluded_paths.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def excluded_paths @excluded_paths end |
#git_timeout ⇒ Object
Returns the value of attribute git_timeout.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def git_timeout @git_timeout end |
#js_global_identifiers ⇒ Object
Returns the value of attribute js_global_identifiers.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def js_global_identifiers @js_global_identifiers end |
#js_program ⇒ Object
Returns the value of attribute js_program.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def js_program @js_program end |
#js_program_exclude ⇒ Object
Returns the value of attribute js_program_exclude.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def js_program_exclude @js_program_exclude end |
#js_syntax_check ⇒ Object
Returns the value of attribute js_syntax_check.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def js_syntax_check @js_syntax_check end |
#lint_timeout ⇒ Object
Returns the value of attribute lint_timeout.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def lint_timeout @lint_timeout end |
#mount_path ⇒ Object
Returns the value of attribute mount_path.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def mount_path @mount_path end |
#redmine_api_key ⇒ Object
Returns the value of attribute redmine_api_key.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def redmine_api_key @redmine_api_key end |
#redmine_enabled ⇒ Object
Returns the value of attribute redmine_enabled.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def redmine_enabled @redmine_enabled end |
#redmine_ticket_source ⇒ Object
Returns the value of attribute redmine_ticket_source.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def redmine_ticket_source @redmine_ticket_source end |
#redmine_url ⇒ Object
Returns the value of attribute redmine_url.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def redmine_url @redmine_url end |
#related_files_custom_paths ⇒ Object
Returns the value of attribute related_files_custom_paths.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def @related_files_custom_paths end |
#resilient_routing ⇒ Object
Returns the value of attribute resilient_routing.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def resilient_routing @resilient_routing end |
#ripgrep_command ⇒ Object
Returns the value of attribute ripgrep_command.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def ripgrep_command @ripgrep_command end |
#rubocop_command ⇒ Object
Returns the value of attribute rubocop_command.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def rubocop_command @rubocop_command end |
#rubocop_server ⇒ Object
Returns the value of attribute rubocop_server.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def rubocop_server @rubocop_server end |
#ruby_def_include_dirs ⇒ Object
Returns the value of attribute ruby_def_include_dirs.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def ruby_def_include_dirs @ruby_def_include_dirs end |
#ruby_lsp ⇒ Object
Returns the value of attribute ruby_lsp.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def ruby_lsp @ruby_lsp end |
#ruby_lsp_command ⇒ Object
Returns the value of attribute ruby_lsp_command.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def ruby_lsp_command @ruby_lsp_command end |
#ruby_lsp_timeout ⇒ Object
Returns the value of attribute ruby_lsp_timeout.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def ruby_lsp_timeout @ruby_lsp_timeout end |
#search_respect_gitignore ⇒ Object
Returns the value of attribute search_respect_gitignore.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def search_respect_gitignore @search_respect_gitignore end |
#search_timeout ⇒ Object
Returns the value of attribute search_timeout.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def search_timeout @search_timeout end |
#test_command ⇒ Object
Returns the value of attribute test_command.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def test_command @test_command end |
#test_framework ⇒ Object
Returns the value of attribute test_framework.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def test_framework @test_framework end |
#test_timeout ⇒ Object
Returns the value of attribute test_timeout.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def test_timeout @test_timeout end |
#user_name_callback ⇒ Object
Returns the value of attribute user_name_callback.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def user_name_callback @user_name_callback end |
#workspace_root ⇒ Object
Returns the value of attribute workspace_root.
5 6 7 |
# File 'lib/mbeditor/configuration.rb', line 5 def workspace_root @workspace_root end |