Project

passages

0.02
No release in over 3 years
Low commit activity in last 3 years
Rails Engine to make internal routes searchable and discoverable for more than just the name of the route. All aspects of a route are searchable from the HTTP verb to the paramters a route supports.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.2
= 0.49.0

Runtime

~> 6.0
 Project Readme

Passages

Build Status

Purpose

This Rails Engine adds the ability to search over different attributes of Ruby on Rails routes within an application.

For example, an internal (or very permissive external) API can now expose a single page that will answer simple questions like: "What was the HTTP verb for the /users/clear_password route?" or "Does a v2 or v3 version for this route exist?".

Demo

Demo

Install

In your Gemfile

source 'https://rubygems.org'
gem 'passages'

bundle install

By default, the Passages Engine must be mounted in your routes.rb file.

Example:

routes.rb

Rails.application.routes.draw do
  mount Passages::Engine, at: '/passages'
end

Alternatively, an initializer can be created that will allow the Passages Engine to mount itself.

Create a new file: initializers/passages.rb and add the following:

Passages.configure do |config|
  config.automount = true
end

With the Engine mounted at /passages, the rendered page will display a search box and list of all known routes within the application.

Rails 5 and Above

Rails 5 apps should use version 2.0 of this gem, everyone below should use 1.5.2

Authorization

Since there are no environment dependent checks, the /passages page uses configurable http basic authentication.

To set a username and password in the Passages Engine, add an ENV variable for each value.

ENV['passages_username'] should be the desired username and ENV['passages_password'] should be the desired password

By default these values are:

username: username

password: password

ENV variables can prefix a Ruby server command from the command line interface, set with a helper .ENV file for systems like foreman or set through a web interface on platforms like heroku.

To disable authentication, create or add to the initializers/passages.rb file:

Passages.configure do |config|
  config.no_auth = true
end

Contributing

Please feel free to fork and contribute your own changes to the Passages project. Single commits are preferred with a description of why the contribution is useful.