{"id":13483855,"url":"https://github.com/brentd/xray-rails","last_synced_at":"2025-03-27T15:30:38.017Z","repository":{"id":692019,"uuid":"8608493","full_name":"brentd/xray-rails","owner":"brentd","description":"☠️ A development tool that reveals your UI's bones","archived":false,"fork":false,"pushed_at":"2024-12-07T21:58:20.000Z","size":425,"stargazers_count":1224,"open_issues_count":33,"forks_count":79,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-09T14:16:20.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brentd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-06T17:02:49.000Z","updated_at":"2025-02-23T12:15:32.000Z","dependencies_parsed_at":"2024-12-07T22:23:51.841Z","dependency_job_id":"02fefb1e-0127-46de-88a0-79ae27fcc954","html_url":"https://github.com/brentd/xray-rails","commit_stats":{"total_commits":200,"total_committers":28,"mean_commits":7.142857142857143,"dds":"0.33999999999999997","last_synced_commit":"f211b5679e5300fd3e7d7a7ecfc84f2003c296e2"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentd%2Fxray-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentd%2Fxray-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentd%2Fxray-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentd%2Fxray-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brentd","download_url":"https://codeload.github.com/brentd/xray-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245871683,"owners_count":20686246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:16.044Z","updated_at":"2025-03-27T15:30:37.445Z","avatar_url":"https://github.com/brentd.png","language":"Ruby","funding_links":[],"categories":["Ruby","Debugging Tools"],"sub_categories":[],"readme":"Xray-rails\n==========\n\n[![Gem Version](https://badge.fury.io/rb/xray-rails.svg)](https://rubygems.org/gems/xray-rails)\n[![Build Status](https://travis-ci.org/brentd/xray-rails.svg?branch=master)](https://travis-ci.org/brentd/xray-rails)\n\n### Reveal your UI's bones\n\nThe dev tools available to web developers in modern browsers are great. Many of us can't remember what life was like before \"Inspect Element\". But what we see in the compiled output sent to our browser is often the wrong level of detail - what about visualizing the higher level components of your UI? Controllers, view templates, partials, JS templates, etc.\n\nXray is the missing link between the browser and your app code. Press **command+shift+x** (Mac) or **ctrl+shift+x** to reveal an overlay of the files that rendered your UI, and click anything to open the file in your editor.\n\n![Screenshot](example/screenshot.png)\n\n## Current Support\n\nXray is intended for Rails 3.1+ and Ruby 1.9+.\n\nSo far, Xray can reveal:\n\n  * Rails views and partials\n  * Javascript templates if using the asset pipeline with the .jst extension\n\n## Installation\n\nXray depends on **jQuery**.\n\nThis gem should only be present during development. Add it to your Gemfile:\n\n```ruby\ngroup :development do\n  gem 'xray-rails'\nend\n```\n\nThen bundle and delete your cached assets:\n\n```\n$ bundle \u0026\u0026 rm -rf tmp/cache/assets\n```\n\nRestart your app, visit it in your browser, and press **command+shift+x** (Mac) or **ctrl+shift+x** to reveal the overlay.\n\n#### Note about `config.assets.debug`\n\nBy default, Xray will insert itself into your views automatically. To do this, `config.assets.debug = true` (Rails' default) must be set in development.rb.\n\nOtherwise, you can insert Xray's scripts yourself, for example like so in application.js:\n\n```js\n//= require jquery\n//= require xray\n```\n\n## Configuration\n\nBy default, Xray will check a few environment variables to determine\nwhich editor to open files in: `$GEM_EDITOR`, `$VISUAL`, then\n`$EDITOR` before falling back to `/usr/local/bin/subl`.\n\nYou can configure your editor of choice either by setting one of these\nvariables, or in Xray's UI, or in an `~/.xrayconfig` YAML file:\n\n```yaml\n:editor: '/usr/local/bin/mate'\n```\n\nFor something more complex, use the `$file` placeholder.\n\n```yaml\n:editor: \"/usr/local/bin/tmux new-window 'vim $file'\"\n```\n\n## How this works\n\n* At run time, HTML responses from Rails are wrapped with HTML comments containing filepath info.\n* A middleware inserts `xray.js`, `xray.css`, and the Xray bar into all successful HTML response bodies.\n* When the overlay is shown, `xray.js` examines the inserted filepath info to build the overlay.\n\n## Disabling Xray\n\nXray augments HTML templates by wrapping their contents with HTML comments. For some environments such as [Angular.js](http://angularjs.org/), this can cause Angular templates to stop working because Angular expects only one root node in the template HTML. You can pass in the option `xray: false` to any partial render statements to ensure Xray does not augment that partial. Example:\n\n```ruby\nrender partial: 'my_partial', locals: { xray: false }\n```\n\nNote that this disables Xray's HTML comment wrappers for `my_partial`, but not any sub-partials rendered within that template, if any. You must pass `xray: false` to each `render` call where you want Xray disabled.\n\nCurrently there is no way to disable Xray entirely for a given request. If this feature is important to you, please leave a comment on [issue #75](https://github.com/brentd/xray-rails/issues/75). PRs are appreciated!\n\n## Contributing\n\nIf you have an idea, open an issue and let's talk about it, or fork away and send a pull request.\n\nA laundry list of things to take on:\n\n  * Reveal views from Ember, Knockout, Angular, etc.\n  * Overlapping boxes are a problem - parent views in real applications will often be obscured by their children.\n  * The current scheme for associating a JS constructor with a filepath is messy and can make stack traces ugly.\n\nWorth noting is that I have plans to solidify xray.js into an API and specification that could be used to aid development in any framework - not just Rails and the asset pipeline.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentd%2Fxray-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrentd%2Fxray-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentd%2Fxray-rails/lists"}