Class: Binocs::Configuration
- Inherits:
-
Object
- Object
- Binocs::Configuration
- Defined in:
- lib/binocs/configuration.rb
Instance Attribute Summary collapse
-
#agent_tool ⇒ Object
Returns the value of attribute agent_tool.
-
#agent_worktree_base ⇒ Object
Returns the value of attribute agent_worktree_base.
-
#authentication_method ⇒ Object
Returns the value of attribute authentication_method.
-
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
-
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#ignored_content_types ⇒ Object
Returns the value of attribute ignored_content_types.
-
#ignored_paths ⇒ Object
Returns the value of attribute ignored_paths.
-
#login_path ⇒ Object
Returns the value of attribute login_path.
-
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
-
#max_requests ⇒ Object
Returns the value of attribute max_requests.
-
#record_request_body ⇒ Object
Returns the value of attribute record_request_body.
-
#record_response_body ⇒ Object
Returns the value of attribute record_response_body.
-
#retention_period ⇒ Object
Returns the value of attribute retention_period.
-
#swagger_spec_url ⇒ Object
Returns the value of attribute swagger_spec_url.
-
#swagger_ui_url ⇒ Object
Returns the value of attribute swagger_ui_url.
Instance Method Summary collapse
- #basic_auth_enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #resolved_login_path ⇒ Object
- #swagger_enabled? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/binocs/configuration.rb', line 22 def initialize @enabled = true @retention_period = 24.hours @max_body_size = 64.kilobytes @ignored_paths = %w[/assets /packs /binocs /cable] @ignored_content_types = %w[image/ video/ audio/ font/] @basic_auth_username = nil @basic_auth_password = nil @max_requests = 1000 @record_request_body = true @record_response_body = true @swagger_spec_url = '/api-docs' @swagger_ui_url = '/api-docs/index.html' @agent_tool = :claude_code @agent_worktree_base = '../binocs-agents' @login_path = nil # Auto-detected from Devise if available, or set manually @authentication_method = nil # e.g., :authenticate_user! or a Proc end |
Instance Attribute Details
#agent_tool ⇒ Object
Returns the value of attribute agent_tool.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def agent_tool @agent_tool end |
#agent_worktree_base ⇒ Object
Returns the value of attribute agent_worktree_base.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def agent_worktree_base @agent_worktree_base end |
#authentication_method ⇒ Object
Returns the value of attribute authentication_method.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def authentication_method @authentication_method end |
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def basic_auth_password @basic_auth_password end |
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def basic_auth_username @basic_auth_username end |
#enabled ⇒ Object
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def enabled @enabled end |
#ignored_content_types ⇒ Object
Returns the value of attribute ignored_content_types.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def ignored_content_types @ignored_content_types end |
#ignored_paths ⇒ Object
Returns the value of attribute ignored_paths.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def ignored_paths @ignored_paths end |
#login_path ⇒ Object
Returns the value of attribute login_path.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def login_path @login_path end |
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def max_body_size @max_body_size end |
#max_requests ⇒ Object
Returns the value of attribute max_requests.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def max_requests @max_requests end |
#record_request_body ⇒ Object
Returns the value of attribute record_request_body.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def record_request_body @record_request_body end |
#record_response_body ⇒ Object
Returns the value of attribute record_response_body.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def record_response_body @record_response_body end |
#retention_period ⇒ Object
Returns the value of attribute retention_period.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def retention_period @retention_period end |
#swagger_spec_url ⇒ Object
Returns the value of attribute swagger_spec_url.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def swagger_spec_url @swagger_spec_url end |
#swagger_ui_url ⇒ Object
Returns the value of attribute swagger_ui_url.
5 6 7 |
# File 'lib/binocs/configuration.rb', line 5 def swagger_ui_url @swagger_ui_url end |
Instance Method Details
#basic_auth_enabled? ⇒ Boolean
41 42 43 |
# File 'lib/binocs/configuration.rb', line 41 def basic_auth_enabled? basic_auth_username.present? && basic_auth_password.present? end |
#resolved_login_path ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/binocs/configuration.rb', line 49 def resolved_login_path return @login_path if @login_path.present? # Try to auto-detect Devise login path if defined?(Devise) && defined?(Rails.application.routes) begin Rails.application.routes.url_helpers.new_user_session_path rescue NoMethodError # Devise might use a different scope '/users/sign_in' end else '/login' end end |
#swagger_enabled? ⇒ Boolean
45 46 47 |
# File 'lib/binocs/configuration.rb', line 45 def swagger_enabled? swagger_spec_url.present? end |