0.0
The project is in a healthy, maintained state
Lets have a look at your rails application in details
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.12
~> 6.0
~> 3.8.0
~> 1.3
~> 2.12
~> 3.8.0
~> 1.48

Runtime

>= 1.1, < 3
>= 3.0.0, < 7.2
 Project Readme

RailsSpotlight

Chrome extension Rails Spotlight.

Support for

  • Rails 5+
  • Ruby 2.6+

Installation

Add this line to your application's Gemfile:

group :development do
  gem 'rails_spotlight'
end

Configuration

Generate configuration file by running:

rails rails_spotlight:generate_config 

file will be created in config/rails_spotlight.yml

Configuration options

  # Default configuration for RailsSpotlight
  PROJECT_NAME: <%=Rails.application.class.respond_to?(:module_parent_name) ? Rails.application.class.module_parent_name : Rails.application.class.parent_name%>
  SOURCE_PATH: <%=Rails.root%>
  STORAGE_PATH: <%=Rails.root.join('tmp', 'data', 'rails_spotlight')%>
  STORAGE_POOL_SIZE: 20
  LOGGER: <%=Logger.new(Rails.root.join('log', 'rails_spotlight.log'))%>
  MIDDLEWARE_SKIPPED_PATHS: []
  NOT_ENCODABLE_EVENT_VALUES:
  SKIP_RENDERED_IVARS: []
  # Rest of the configuration is required for ActionCable. It will be disabled automatically in when ActionCable is not available.
  # LIVE_CONSOLE_ENABLED from version 0.2.3 do not require ActionCable to be enabled.
  LIVE_CONSOLE_ENABLED: false
  # Experimental feature.
  REQUEST_COMPLETED_BROADCAST_ENABLED: false
  AUTO_MOUNT_ACTION_CABLE: false
  ACTION_CABLE_MOUNT_PATH: /cable
  BLOCK_EDITING_FILES: false
  BLOCK_EDITING_FILES_OUTSIDE_OF_THE_PROJECT: true

Additional metrics

To enable additional rendering metrics like local variables, instance variables, params etc. add to your layout file:

<% if Rails.env.development? %>
  <%= RailsSpotlight::RenderViewReporter.report_rendered_view_locals(self, locals: local_assigns, params: params, skip_vars: %i[current_template], metadata: { just_test: 'Works' }) %>
<% end %>

Troubleshooting

Known issue:

Authentication error when using:

  • Specific authentication method and action cable
  • AUTO_MOUNT_ACTION_CABLE: true

Solution:

  • Set AUTO_MOUNT_ACTION_CABLE: false
  • Add manually mount ActionCable.server => '/cable' to config/routes.rb with proper authentication method

Requests crash when ActionCable settings -> Use action cable for meta requests (required for Safari) is on

Solution:

  • Switch flag off
  • REQUEST_COMPLETED_BROADCAST_ENABLED: false

Testing

To run tests for all versions of Rails and Ruby, run:

docker-compose up

Usage

Gem is created for the Chrome extension Rails Spotlight, but it can be used for any purpose.

License

The gem is available as open source under the terms of the MIT License.